sangoma / switchy

async FreeSWITCH cluster control
https://switchy.readthedocs.io/en/latest/
Mozilla Public License 2.0
69 stars 18 forks source link

Schedule commands should return proper futures #55

Open goodboy opened 7 years ago

goodboy commented 7 years ago

models.Session includes some methods which schedule future tasks with Freeswitch.

The details of how such tasks are cancelled or otherwise handled should be wrapped in an appropriate concurrent.futures.Future or asyncio.Future much like how Client.bgapi() returns instances our hand rolled future-like Job type. Maybe a Task is an even better analogue?

Further, we should adjust our current Job to be compatible with the new interface as it was originally based off multiprocessing.AsyncResult.