#NEWLINE# def ask( self , anActor , msg , timeout ) : #NEWLINE# #INDENT# self . _ASKFAILED = None #NEWLINE# self . transport . scheduleTransmit ( None , TransmitIntent ( anActor , msg , onError = self . _askSendFailed ) ) #NEWLINE# while True : #NEWLINE# #INDENT# response = self . transport . run ( None , toTimeDeltaOrNone ( timeout ) ) #NEWLINE# if ( response is None ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# if ( self . _ASKFAILED is not None ) : #NEWLINE# #INDENT# if ( self . _ASKFAILED in [ SendStatus . DeadTarget , SendStatus . Failed , SendStatus . NotSent ] ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# raise ActorSystemFailure ( ( 'Transmit of ask message to %s failed (%s)' % ( str ( anActor ) , str ( self . _ASKFAILED ) ) ) ) #NEWLINE# #UNINDENT# if ( response and ( not isInternalActorSystemMessage ( anActor . message ) ) ) : #NEWLINE# #INDENT# return response . message #NEWLINE# #UNINDENT# #UNINDENT# return None