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

Queue messages until "condition" is met #10

Open
optimumtact opened this issue Apr 18, 2016 · 1 comment
Open

Queue messages until "condition" is met #10

optimumtact opened this issue Apr 18, 2016 · 1 comment

Comments

@optimumtact
Copy link
Owner

optimumtact commented Apr 18, 2016

Consider that you often cannot send irc join messages until you have gone through at least the basic connection to the irc serv.

the bot currently has some hardcoded logic to queue any and all join events until it sees the end of the message of the day, or the no motd response and then it sends all queued channel join events.

This would be quite useful if this abstraction could be extended to support generic queueing for outgoing bot events.

The current plan looks a little something like this

a dict of {stateflag -> list} where the list is a list of held outbound events

when the stateflag is set to true, the queued list of events is sent and all future events pertaining to this stateflag are sent immediately.

If the stateflag is toggled back to false then they start queueing again.

I have not yet encountered any other items that would potentially need this yet, but I can think of a few uses where a module might find it useful, hence the generalisation

@optimumtact
Copy link
Owner Author

Now that I think about it, it's plausible that spam control could potentially be handled through this, as a default filter applied to every single item, so if the spam limit flag goes on, events would be queued

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

No branches or pull requests

1 participant