pydle
pydle copied to clipboard
[asyncio] Add clients to ClientPool while it is running
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.
(Sorry for the initial empty posting!)
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