#NEWLINE# @ needs_zmq #NEWLINE# def poll_messages( ) : #NEWLINE# #INDENT# '\n    Call periodically from the parent process to check for messages\n    and call and handlers.\n    ' #NEWLINE# while True : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# data = _conn_details . sink . recv ( flags = zmq . NOBLOCK ) #NEWLINE# compressed = _conn_details . sink . recv_json ( ) #NEWLINE# #UNINDENT# except zmq . ZMQError : #NEWLINE# #INDENT# e = sys . exc_info ( ) [ 1 ] #NEWLINE# if ( e . errno == zmq . EAGAIN ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# raise #NEWLINE# #UNINDENT# ( subject , message ) = _serializer . deserialize ( data , compressed ) #NEWLINE# for handler in _handlers . get ( subject , [ ] ) : #NEWLINE# #INDENT# handler ( e , message )