Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow easily running event processing "*not* in a background thread" #66

Open
goodboy opened this issue Jan 27, 2019 · 0 comments
Open

Comments

@goodboy
Copy link
Member

goodboy commented Jan 27, 2019

By default switchio's internal event loop spawns a background thread which runs an asyncio event loop for processing events from FS. The original reason for this was legacy (before porting to asyncio) but still serves a useful purpose - that you can run switchio non-blocking alongside other blocking frameworks or programs from a single python process.

Now that this project is officially python 3.5+ only and has full support for asyncio we should allow users to be able to run event processing all in thread (using one asyncio loop) if desired.

The changes required for this shouldn't be too hard, but we'll need to mess with some plumbing:

See @enp's example app using just the switchio.api.Connection in #61 for the original use case.

@goodboy goodboy changed the title Allow running event processing *not* in a background thread easily Allow easily running event processing "*not* in a background thread" Feb 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant