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

EventMixer Agent #262

Open
snicker opened this issue Apr 23, 2014 · 7 comments
Open

EventMixer Agent #262

snicker opened this issue Apr 23, 2014 · 7 comments

Comments

@snicker
Copy link
Contributor

snicker commented Apr 23, 2014

Ideas/Specs for a new agent:

EventMixer would take multiple incoming events and combine them into one outgoing event.

Multiple modes of functionality:

  1. "Waiting" mode

    It should:

    • Know the sources of incoming events
    • Merge any incoming events from all sources
    • Have a user configurable window of time
    • Wait until an event has been received from each source within the time window
    • Clear the queue if events are not received from all sources within the time window
    • Emit the merged event if events are received from all sources and clear the queue
  2. "Automatic" mode

    It should:

    • Merge any incoming events from all sources
    • Have a user configurable window of time
    • Merge incoming events received within this window of time.
      • Clock starts upon first received event since last outgoing event
    • Emit the merged event if the window of time has elapsed and clear the queue
  3. "Scheduled" mode

    it should:

    • Merge any incoming events from all sources
    • Run on a schedule
    • Emit the merged event upon the scheduled time and clear the queue
@snicker
Copy link
Contributor Author

snicker commented Apr 23, 2014

I'll probably work on this when I have time, unless someone else wants to take it on. Just wanted to get functional ideas written down and out for comment.

Example use case:

User wants to check the balance of a checking account and a credit card periodically and automatically make a payment if the balance of the checking account is greater than the credit card. Since the data would come from two different sources and both pieces of data need to be present to make a decision in a TriggerAgent, the event mixer would need to combine them and re-emit, but only if both events were generated by their respective agents.

@cantino
Copy link
Member

cantino commented Apr 24, 2014

That makes sense. It would be awesome if you could attempt a general solution for it. Maybe you tell it how many events from each source it needs before it re-emits? It's kind of a hard Agent to generalize for every use case.

@snicker
Copy link
Contributor Author

snicker commented Apr 24, 2014

start simple, right? can always add more functionality later.

@cantino
Copy link
Member

cantino commented Apr 24, 2014

Agreed :)

@0xdevalias
Copy link
Member

Along this line of thinking (but not necessarily related), is it possible to output multiple different types of events from the one agent? I've been meaning to look into a 'splitter' type agent, but haven't had the time to see if a) it's possible and b) if it already exists in some way.

I assume it's probably already possible to do, at least on an individual agent level (outputting different event types)

Along another similar line (sorry for hijacking the thread!), is there currently any concept of a 'global' event listener (that doesn't need to be manually wired up), and if not, does the event propagation architecture support this sort of thing easily/at all?

@cantino / anyone else who could answer my rambling thoughts :)

@cantino
Copy link
Member

cantino commented Apr 27, 2014

@alias1, maybe you can start an issue to discuss this? I'd like to know more what you mean by a "splitter" agent. It should be possible to make an Agent listen to everything, although it might not be very performant.

@Surrogard
Copy link

Hi,
are there any news on the EventMixer?
I helped myself out with the CommanderAgent in the "configure" mode by changing values in the other event and only using the trigger of the other, but it is a bit clumsy and only works in this case because the value changes only seldom.
I'm no good at Ruby otherwise I would take a look at it myself, perhaps I could "cheat up" something with the JavaScriptAgent...

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

No branches or pull requests

4 participants