Skip to content

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