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

[asyncio] Add clients to ClientPool while it is running #83

Open
Simon-L opened this issue Oct 6, 2018 · 2 comments
Open

[asyncio] Add clients to ClientPool while it is running #83

Simon-L opened this issue Oct 6, 2018 · 2 comments

Comments

@Simon-L
Copy link

Simon-L commented Oct 6, 2018

Is there a way to add clients to a ClientPool while it is running?
Basically, a single client works fine with the new asyncio compatibility.
Now I'd like to spawn multiple bots/clients, after the loop has started, and keep asyncio compatibility to include it as part of a bigger program, also making use of asyncio functionality.

@Simon-L Simon-L changed the title [asyncio] [asyncio] Add clients to ClientPool while it is running Oct 6, 2018
@Simon-L
Copy link
Author

Simon-L commented Oct 6, 2018

(Sorry for the initial empty posting!)

@theunkn0wn1
Copy link
Collaborator

In theory you should be able to pass an event loop to the Client constructor, though ive never tried this myself.

client = Client(..., loop=existing_event_loop)

where existing_event_loop is the event loop you want the new Client instance to run in

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

2 participants