#NEWLINE# def main( ) : #NEWLINE# #INDENT# done = goless . chan ( ) #NEWLINE# msgs = goless . chan ( ) #NEWLINE# out = goless . chan ( ) #NEWLINE# def produce( ) : #NEWLINE# #INDENT# for i in range ( 10 ) : #NEWLINE# #INDENT# msgs . send ( i ) #NEWLINE# #UNINDENT# done . send ( ) #NEWLINE# #UNINDENT# def consume( name ) : #NEWLINE# #INDENT# for msg in msgs : #NEWLINE# #INDENT# out . send ( ( '%s:%s ' % ( name , msg ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# def logger( ) : #NEWLINE# #INDENT# for msg in out : #NEWLINE# #INDENT# sys . stdout . write ( msg ) #NEWLINE# #UNINDENT# sys . stdout . write ( '\n' ) #NEWLINE# #UNINDENT# goless . go ( produce ) #NEWLINE# goless . go ( consume , 'one' ) #NEWLINE# goless . go ( consume , 'two' ) #NEWLINE# goless . go ( logger ) #NEWLINE# done . recv ( )