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

"Triggers" #8

Open
cosgroveb opened this issue Jan 27, 2012 · 2 comments
Open

"Triggers" #8

cosgroveb opened this issue Jan 27, 2012 · 2 comments
Labels
Milestone

Comments

@cosgroveb
Copy link
Owner

Jane should be able to be configured to send messages to chat rooms based on pre-defined "triggers". Bot would poll services and conditionally send messages.

For instance, if a Jenkins build breaks, jane would notify #dev.

@benmills
Copy link
Collaborator

benmills commented Feb 9, 2012

Here is what I'm thinking for v1 of triggers.

Properties of a trigger:

  • Resource - the URL or thing Jane will keep looking at
  • Frequency - how often Jane should inspect the Resource
  • Change Condition - the way the Resource is evaluated to determine if the trigger should be activated
  • Activate - the code that is fired when Change Condition is true.
  • Subscriber - the room Jane show notify with return value of Active

From an implementation stand point I see all this wrapped in a record that is turned into a trigger_worker by a trigger_sup. The trigger_worker might be a FSM that has a timer that will call check the Resource against the Change Condition.

Jane will have a trigger command that will list all available triggers and two subcommands to register a trigger for the current room or deregister the current room. This should help deal with the inevitable problem of Jane spamming a room.

I think the development plan should be to get a working trigger_worker as a standalone module and then build out the commands and trigger_sup.

@benmills
Copy link
Collaborator

While I was playing around with processes on Friday I found this function: timer:send_after that sends a message to it's own process or a given process. Using send_after should make implementing triggers much easier.

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

No branches or pull requests

2 participants