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

Added "delay" option for rate limiting #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jonoxer
Copy link

@jonoxer jonoxer commented Mar 7, 2012

The label is not final (I don't like the term "delay" in this context) but this is a functional proof of concept at least

@geekscape
Copy link
Owner

I like where this is going. I propose that we attempt something more flexible ...

Command line argument is "-r rule_expression" or "--rule rule_expression", where the equivalent to your code would be "--rule period=10" (instead of "-d 10"). This will allow a variety of rules to be applied in the future.

The rule handling code in your callback would be moved into a library "rules.lua", which would contain the rule expression parser and a "rule_check(rule_expression)" function, which indicates whether the rule conditions have been met (and then publishing the message should occur). This means that the rules could be used by many applications / examples without having to duplicate code in every callback.

In time, the various rules may become extensible plug-ins.

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

Successfully merging this pull request may close these issues.

2 participants