Displaying 2 results from an estimated 2 matches for "set_start_method".
2017 Jun 30
2
Simplest way of executing a non-blocking (async) python AGI script?
...1) # close C's stdout stream
os.close(2) # close C's stderr stream
time.sleep(2)
f = open('/var/lib/asterisk/agi-bin/tns/testing/testout.txt', 'w')
f.write(name)
f.close()
if __name__ == '__main__':
print('before process')
mp.set_start_method('fork')
q = mp.Queue()
p = mp.Process(target=f, args=('asterisk',))
p.start()
sys.exit()
On 30 June 2017 at 19:59, J Montoya or A J Stiles
<asterisk_list at earthshod.co.uk> wrote:
> On Friday 30 Jun 2017, Jonathan H wrote:
>> What's the simplest,...
2017 Jun 30
3
Simplest way of executing a non-blocking (async) python AGI script?
I use a python AGI which pulls some info from a web service, which should
take half a second.
Sometimes, it takes 5-10 seconds which blocks the dialplan execution, but
the dialplan should continue immediately as it's not dependent on the
AGI/web service data.
What's the simplest, easiest quickest least-code way of firing off an AGI
with some variable, and then returning to the dialplan?