-
Notifications
You must be signed in to change notification settings - Fork 3
SupervisionTrees
hyperthunk edited this page Apr 17, 2011
·
3 revisions
This page explains the supervision trees for each of the nodewatch applications.
This is the most complex supervision tree in the system, consisting of several sub-trees and using a variety of supervision models. The overall structure looks like this:
x-----------x
x------------------| dxkit_sup |-------------------------------x
| x-----------x |
| | |
| | |
x------------x----------x x--------x------------x x-------------------x------------------x
| dxkit_event_subsystem | | dxkit_net_subsystem | | dxkit_monitor_subscription_subsystem |
| <<supervisor>> | | <<supervisor>> | | <<supervisor>> |
x-----------------------x x---------------------x x--------------------------------------x
The event subsystem comprises a locally registered gen_event manager and a simple_one_for_one supervisor which acts as a bridge between the event manager and the gen_event handler (callback modules), by wrapping the handler(s) in a gen_server. This _handler bridge_ catches abnormal exits in the event handlers and stops, which in turn triggers the event_bridge` to restart the handler.
x-----------------------x
| dxkit_event_subsystem |
x-----------| <<supervisor>> |------------x
| x-----------------------x |
| |
x-----------x---------x x----------x---------x
| dxkit_event_handler | | dxkit_event_bridge |
| <<gen_event/mgr>> | | <<supervisor>> |
x---------------------x x----------x---------x
v
v
v
x----------V-----------x
| event handler bridge |
| <<gen_server>> |
x----------------------x