#NEWLINE# def _process_lane_rxmsg( self , msg , sender ) : #NEWLINE# #INDENT# '\n        Send uxd messages tot he right queue or forward them to the correct\n        yard etc.\n\n        msg is message body dict\n        sender is unique name  of remote that sent the message\n        ' #NEWLINE# try : #NEWLINE# #INDENT# ( s_estate , s_yard , s_share ) = msg [ 'route' ] [ 'src' ] #NEWLINE# ( d_estate , d_yard , d_share ) = msg [ 'route' ] [ 'dst' ] #NEWLINE# #UNINDENT# except ( ValueError , IndexError ) : #NEWLINE# #INDENT# log . error ( 'Lane Router Received invalid message: {0}' . format ( msg ) ) #NEWLINE# return #NEWLINE# #UNINDENT# if ( s_yard is None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( s_estate is None ) : #NEWLINE# #INDENT# s_estate = self . road_stack . value . local . name #NEWLINE# msg [ 'route' ] [ 'src' ] = ( s_estate , s_yard , s_share ) #NEWLINE# #UNINDENT# log . debug ( '**** Lane Router rxMsg **** id={0} estate={1} yard={2}\n   msg={3}\n' . format ( self . opts . value [ 'id' ] , self . road_stack . value . local . name , self . lane_stack . value . local . name , msg ) ) #NEWLINE# if ( d_estate is None ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( d_estate != self . road_stack . value . local . name ) : #NEWLINE# #INDENT# if ( d_estate in self . road_stack . value . nameRemotes ) : #NEWLINE# #INDENT# self . road_stack . value . message ( msg , self . road_stack . value . nameRemotes [ d_estate ] . uid ) #NEWLINE# #UNINDENT# return #NEWLINE# #UNINDENT# #UNINDENT# if ( d_share == 'pub_ret' ) : #NEWLINE# #INDENT# msg [ 'return' ] [ 'ret' ] [ 'minions' ] = self . _availablize ( msg [ 'return' ] [ 'ret' ] [ 'minions' ] ) #NEWLINE# if ( msg . get ( '__worker_verify' ) == self . worker_verify . value ) : #NEWLINE# #INDENT# self . publish . value . append ( msg ) #NEWLINE# #UNINDENT# #UNINDENT# if ( d_yard is None ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( d_yard != self . lane_stack . value . local . name ) : #NEWLINE# #INDENT# if ( d_yard in self . lane_stack . value . nameRemotes ) : #NEWLINE# #INDENT# self . lane_stack . value . transmit ( msg , self . lane_stack . value . nameRemotes [ d_yard ] . uid ) #NEWLINE# #UNINDENT# return #NEWLINE# #UNINDENT# #UNINDENT# if ( d_share is None ) : #NEWLINE# #INDENT# log . error ( 'Lane Router Received message without share: {0}' . format ( msg ) ) #NEWLINE# return #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( d_share == 'local_cmd' ) : #NEWLINE# #INDENT# self . lane_stack . value . transmit ( msg , self . lane_stack . value . fetchUidByName ( next ( self . workers . value ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( d_share == 'event_req' ) : #NEWLINE# #INDENT# self . event_req . value . append ( msg ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( d_share == 'event_fire' ) : #NEWLINE# #INDENT# self . event . value . append ( msg ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( d_share == 'presence_req' ) : #NEWLINE# #INDENT# self . presence_req . value . append ( msg ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( d_share == 'stats_req' ) : #NEWLINE# #INDENT# self . stats_req . value . append ( msg )