sangoma / switchy

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

Port to asyncio! #54

Open goodboy opened 7 years ago

goodboy commented 7 years ago

Now that #44 is in we can begin the move to asyncio based apps! I'm thinking most of the built-ins can be implemented as single coroutine instead of namespace defined callbacks.

autobahn has a good read on the contrast with twisted.

goodboy commented 7 years ago

For py2, I'm thinking we can probably follow pep342 as a guide for implementing our own "inline-callbacks" like in twisted. I think we can probably introspect a callback to see if it's a generator instead of using a different decorator.

For py3.5 we'll obviously use proper coroutines and most likely custom futures for suspending until specific events.