Skip to content

Instantly share code, notes, and snippets.

@antirez
Created April 1, 2010 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antirez/352046 to your computer and use it in GitHub Desktop.
Save antirez/352046 to your computer and use it in GitHub Desktop.
set numclients 50
set ::reads 0
for {set i 0} {$i < $numclients} {incr i} {
set fd [socket 127.0.0.1 6379]
fconfigure $fd -translation binary -blocking 0
set ::client($i) $fd
puts -nonewline $fd "SUBSCRIBE foo\r\n"
flush $fd
fileevent $fd readable [list discardData $fd]
}
proc discardData fd {
read $fd
incr ::reads
if {($::reads % 10000) == 0} {
puts "$::reads reads"
}
}
vwait forever
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment