<s> from diesel import quickstart , quickstop , sleep , first <EOL> from diesel . protocols . zeromq import DieselZMQSocket , zctx , zmq <EOL> import time <EOL> def get_messages ( ) : <EOL> outsock = DieselZMQSocket ( zctx . socket ( zmq . DEALER ) , bind = "<STR_LIT>" ) <EOL> for x in xrange ( <NUM_LIT:1000> ) : <EOL> t , m = first ( sleep = <NUM_LIT:1.0> , waits = [ outsock ] ) <EOL> if t == '<STR_LIT>' : <EOL> print "<STR_LIT>" <EOL> else : <EOL> print "<STR_LIT>" , m <EOL> quickstop ( ) <EOL> quickstart ( get_messages ) </s>
