basiliscos / cpp-rotor

Event loop friendly C++ actor micro-framework, supervisable
MIT License
344 stars 33 forks source link

introduce shutdown reason + more debugging #22

Closed basiliscos closed 3 years ago

basiliscos commented 4 years ago

Sometimes it seems unclear why hierarchy is collapsing. It is obvious, that something happen, but not clear what is the root reason. So, when something go wrong, the shutdown message should setup error_code for easier examination of a supervisor.

In addition, when actor starts initialization, in the debug mode, it should print it's address and it's type. When it is going to down, it should also print it's type, address and the shutdown reason.

Seems not so complex to do.

basiliscos commented 3 years ago

It seems not so usable as expected, because in reality there is a need of hierarchy of failures, rather then single reason, e.g.

supervisor shut down, because it's child failed to init
the child failed to init, because lit failed to discover "server::name"
which does not exist in the registry at the moment

The std::error_code does not support that, so, it seems, in the rotor-core there is needed to develop own ErrorCode to handle that...

basiliscos commented 3 years ago

resolved with v0.14