#NEWLINE# def backend_preparation( self , msg ) : #NEWLINE# #INDENT# 'Queue outbound message to be processed in the background.' #NEWLINE# context = msg . extra_backend_context ( ) #NEWLINE# grouped_identities = self . group_outgoing_identities ( msg ) #NEWLINE# for ( backend_name , identities ) in grouped_identities . items ( ) : #NEWLINE# #INDENT# eager = self . is_eager ( backend_name ) #NEWLINE# if eager : #NEWLINE# #INDENT# logger . debug ( 'Executing in current process' ) #NEWLINE# send_async ( backend_name , msg . id , msg . text , identities , context ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logger . debug ( 'Executing asynchronously' ) #NEWLINE# send_async . delay ( backend_name , context . id , msg . text , identities , context )