<s> import sys , logging <EOL> import asyncoro . disasyncoro as asyncoro <EOL> def sender_proc ( rchannel , coro = None ) : <EOL> for x in range ( <NUM_LIT:10> ) : <EOL> msg = { '<STR_LIT>' : '<STR_LIT>' % x , '<STR_LIT>' : coro } <EOL> n = yield rchannel . deliver ( msg , n = <NUM_LIT:2> ) <EOL> print ( '<STR_LIT>' % n ) <EOL> rchannel . send ( None ) <EOL> def receiver_proc2 ( coro = None ) : <EOL> rchannel = yield asyncoro . Channel . locate ( '<STR_LIT>' ) <EOL> print ( '<STR_LIT>' % rchannel . location ) <EOL> if ( yield rchannel . subscribe ( coro ) ) != <NUM_LIT:0> : <EOL> raise Exception ( '<STR_LIT>' ) <EOL> asyncoro . Coro ( sender_proc , rchannel ) <EOL> while True : <EOL> msg = yield coro . receive ( ) <EOL> if msg is None : <EOL> break <EOL> print ( '<STR_LIT>' % ( msg [ '<STR_LIT>' ] , msg [ '<STR_LIT>' ] . name , msg [ '<STR_LIT>' ] . location ) ) <EOL> yield rchannel . unsubscribe ( coro ) <EOL> asyncoro . logger . setLevel ( logging . DEBUG ) <EOL> asyncoro . Coro ( receiver_proc2 ) </s>
