#NEWLINE# def run( self ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# self . req_socket . bind ( self . get_uri ( 'requests' ) ) #NEWLINE# self . notif_socket . bind ( self . get_uri ( 'notifs' ) ) #NEWLINE# self . ready . set ( ) #NEWLINE# poller = zmq . Poller ( ) #NEWLINE# poller . register ( _ . req_socket , zmq . POLLIN ) #NEWLINE# poller . register ( self . notif_socket , zmq . POLLIN ) #NEWLINE# while True : #NEWLINE# #INDENT# for ( socket , _ ) in poller . poll ( ) : #NEWLINE# #INDENT# if ( socket == self . req_socket ) : #NEWLINE# #INDENT# self . request ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( socket == self . notif_socket ) : #NEWLINE# #INDENT# self . notif ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# except ( zmq . ZMQError , EscalatorClosed ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# self . req_socket . close ( linger = 0 ) #NEWLINE# self . notif_socket . close ( linger = 0 )