Broker client
Any application having something interesting to broadcast can publish
a notification to our broker, directly or through the notificaitons center.
We have an AMQP client to connect to the broker.
Fixes T616.
Notifications
Every second, Wearg reads the notifications queue and will broadcast
notifications.
We provide an notifications handler to send notifications to the right IRC channels.
Fixes T581.
Bot setup
First, this requires a TCL extension to inteact with an AMQP client
(see dereckson/rabbitmq-tcl).
To use this:
source Wearg/Broker.tcl source Wearg/Notifications.tcl notifications::init broker::init
Note: don't forget the notifications::init: if you don't bind the notifications
before starting to get messages, they will be lost.
To recover after an issue, broker::on_tick should be enough to restart the timer
(check utimers to know if you've lost one on an error)
Extend the code
To get a notification: notifications::bind <service> <projec> <group> <type> <callback procedure>.
The callback procedure will get service project group rawContent type text link as arguments.
To get a broker message: broker::bind <queue> <callback procedure>
The callback procedure wil lget queue message as arguments.