Mostly for educational purposes, I'm trying to write a task (the task is open_port ({spawn_executable, Command})) scheduler.
I end up with a tree like
supervisor
| |
scheduler receiver
gen_event gen_event
|
supervisor
|
dispatcher
gen_server
|
supervisor
| | |
task1 ... taskN
In other words:
- top supervisor launches the scheduler and receiver and ensures that they are alive
- the receiver starts the middle supervisor
- the middle manager starts the dispatcher and is sure that he will be alive
- dispatcher starts the bottom dispatcher
the lower supervisor starts tasks upon request and guarantees their restart in case of an error
at any time, the scheduler is ready to accept the task with a timestamp that he must complete in
- when a timestamp is encountered, it notifies some event_manager
- -, , , .
- , , , -
- , -
- , -
:
- ?
- ? ( .)
- + + 4 ?
- + + , , gen_event + gen_server + supervisor?
- , OO? ( 3 4.)
.
. . , , ; , (, , , , - ). ?