friends-of-freeswitch / switchio

asyncio powered FreeSWITCH cluster control
http://switchio.rtfd.io
Mozilla Public License 2.0
191 stars 28 forks source link

Allow running event loop in main thread #36

Open goodboy opened 6 years ago

goodboy commented 6 years ago

@vodik made another good point that we should support running event loops without a background thread. The user of the loop should be able to make the decision whether or not it should be run blocking. Support for this should be carefully considered as the eventual plan is to support multi-core via asyncio loops using multiprocessing.

I propose supporting this depending on how EventLoop is run/started (say via a block kwargs). This also drums up questions about whether separate connect() and start() methods are even needed. The original motivation was to allow for event unsubscription via unsubscribe().