Asynchronous dispatcher based on pydispatch from thread import start_n

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
"""Asynchronous dispatcher based on pydispatch"""
from thread import start_new_thread
from pydispatch.dispatcher import *
def sendAsync(signal=Any, sender=Anonymous, *arguments, **named):
"""Send signal from sender to all connected receivers asynchronously and
dismiss the response"""
named.update({
'signal': signal,
'sender': sender
})
for receiver in liveReceivers(getAllReceivers(sender, signal)):
start_new_thread(robustapply.robustApply, [receiver] + arguments,
named)