shizmob / pydle

An IRCv3-compliant Python 3 IRC library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[asyncio] Add clients to ClientPool while it is running

Simon-L opened this issue · 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.

(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