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

Can clients be reused after reactor shutdown? #168

Open
8573 opened this issue Dec 22, 2018 · 0 comments
Open

Can clients be reused after reactor shutdown? #168

8573 opened this issue Dec 22, 2018 · 0 comments

Comments

@8573
Copy link

8573 commented Dec 22, 2018

While looking into how I could implement reconnection after ping-timeout in irc-bot, I hit this question. Suppose that—

  • several IrcClients are cloned;
  • their clones are registered with an IrcReactor r with r.register_client_with_handler(...); and
  • r.run() is called and, after running for a while, returns.

Can the same sequence of events safely be repeated, registering new clones of the same IrcClients with the same IrcReactor and running the reactor again?

I would guess that, if the reactor shut down because a connection failed, the IrcClient corresponding to that connection no longer would be usable, but what about the other clients running on the same reactor?

I would like to suggest that the answer be documented, covering whether an IrcClient c that was being run on an IrcReactor can be reused thus in the following cases:

  • the run call returns Ok;
  • the run call returns Err because of a problem with c; and
  • the run call returns Err otherwise, such as because of a problem with a different IrcClient.

I note, largely for the sake of making GitHub create cross-references between these issue tickets, that this seems relevant to tickets #88 and #167.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants