#NEWLINE# def cast( self , method , args = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , declare = None , retry = None , retry_policy = None , type = None , exchange = None , **props ) : #NEWLINE# #INDENT# 'Send message to actor.  Discarding replies.' #NEWLINE# retry = ( self . retry if ( retry is None ) else retry ) #NEWLINE# body = { #NEWLINE# #INDENT# 'class' : self . name , #NEWLINE# 'method' : method , #NEWLINE# 'args' : args , #NEWLINE# #UNINDENT# } #NEWLINE# _retry_policy = self . retry_policy #NEWLINE# if retry_policy : #NEWLINE# #INDENT# _retry_policy = dict ( _retry_policy , ** retry_policy ) #NEWLINE# #UNINDENT# if ( type and ( type not in self . types ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Unsupported type: {0}' . format ( type ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not type ) : #NEWLINE# #INDENT# type = ACTOR_TYPE . DIRECT #NEWLINE# #UNINDENT# #UNINDENT# props . setdefault ( 'routing_key' , self . routing_key ) #NEWLINE# props . setdefault ( 'serializer' , self . serializer ) #NEWLINE# exchange = ( exchange or self . type_to_exchange [ type ] ( ) ) #NEWLINE# declare = ( ( maybe_list ( declare ) or [ ] ) + [ exchange ] ) #NEWLINE# with producers [ self . _connection ] . acquire ( block = True ) as producer : #NEWLINE# #INDENT# return producer . publish ( body , exchange = exchange , declare = declare , retry = retry , retry_policy = retry_policy , ** props )