-
Notifications
You must be signed in to change notification settings - Fork 1
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
Consider context manager: irc.ensure_connection #15
Comments
If this is implemented (and I understand it correctly), then:
Commands such as Is it possible to tell (without using |
I have created a (WIP) |
Is the new |
It is, |
Are you still interested in this being added to miniirc itself (as opposed to being a feature in another package)? |
No. For now I think it's okay to have it in miniirc-extras. If I later have a compelling reason for wanting it in miniirc itself, I may then revisit the topic. |
Per our prior discussion, this issue exists to think about and possibly implement a context manager which offers a better than normal reliability of an active connection. It is intended to be used for short periods of time such as when sending a batch of messages or other commands. It could work by internally using PING and expecting PONG at a far higher rate than usual rate of
ping_interval
. The user's code can look something like this:If the PING/PONG strategy is used, if the PONG is not received within say
timeout
seconds (default 2) of the PING,irc.ConnectionError
can be raised. A PING could be sent everyperiod
seconds (default 3), and also definitely when releasing the context! I don't know IRC well enough, so this is my naive strategy.I especially haven't given enough thought to the blocking vs non-blocking nature of this context manager, and so I'm hesitant to request it at all. Often the commands that are run are very time-sensitive, and it may not make sense to wait much to run them.
The text was updated successfully, but these errors were encountered: