Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Agent Workflow

John E. Vincent edited this page Mar 1, 2011 · 1 revision

Agent Workflow

This is the tentative agent workflow idea. Feedback is welcome.

Components


The agent process consists of the following "components":

  • Reactor
    • Master Channel
    • EM::Hiredis::Client instance
      • Redis Pub/Sub
    • EM::NoahAgent instance
      • EM.Spawn http worker
      • EM.Spawn log worker
      • EM.Spawn amqp worker
      • EM.Spawn redis worker

Master Channel

Instance of EM::Channel Messages are pushed to the channel by EM::Hiredis::Client reading Redis Pub/Sub messages. Any Redis messages matching pattern //noah/watcher invoke EM::NoahAgent.reread_watchers which forces a reload of all registered watchers.

A subscriber to master_channel then calls EM::NoahAgent.broker with the message

EM::NoahAgent

Messages passed to the broker method should be filtered and sent to the appropriate EM.Spawn process via .notify to notify the endpoint.

It feels like there are some moving parts that can be eliminated. I need to determine the most efficient way to filter messages into the right bucket. Should that be handled by the EM.spawn or by .broker? We have a registry of all known watchers at the EM::NoahAgent.watchers class variable.

Clone this wiki locally