pydle icon indicating copy to clipboard operation
pydle copied to clipboard

[asyncio] Add clients to ClientPool while it is running

Open Simon-L opened this issue 6 years ago • 2 comments

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 avatar Oct 06 '18 10:10 Simon-L

(Sorry for the initial empty posting!)

Simon-L avatar Oct 06 '18 10:10 Simon-L

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

theunkn0wn1 avatar Dec 23 '18 04:12 theunkn0wn1