Details
-
Feature Request
-
Resolution: Done
-
Major
-
None
-
None
-
0
-
0%
Description
SUPERVISOR is a protocol anywhere in the stack that passes messages up and down by default; it doesn't take part in message processing.
However, it handles events ADD_RULE / REMOVE_RULE, which adds/removes rules. A rule is a condition with a name, an interval and an (optional) action.
When the interval for a condition has elapsed, it is triggered and (if true) it'll invoke the associated action. A condition can be triggered by an interval elapsed or perhaps also when a event is received (e.g. a view change).
Example:
- Condition: check if FD is present in the stack. If it is and fd.isMonitorRunning() == false and fd.getView().size() > 1, then call action fd.startFailureDetection() and log an error message.
The error messages are stored in a bounded list, so the last N error messages can be retrieved, e.g. via probe.sh.
A rule should be able to be invoked manually, e.g. via probe.
SUPERVISOR could be configured with a file which lists the rules to be created (class name, interval, description etc) at startup.