-
Notifications
You must be signed in to change notification settings - Fork 163
Agent Workflow
This is the tentative agent workflow idea. Feedback is welcome.
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
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
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.