Created
April 1, 2010 16:29
-
-
Save antirez/352046 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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