basiliscos / cpp-rotor

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

address contains non-owning pointer to supervisor #9

Closed basiliscos closed 2 years ago

basiliscos commented 5 years ago

as address contains non-owning pointer to a supervisor it might be case when the supervisor is shutdown and destroyed, and a message is sent to it => crash.

On the other hand, the client/server relationship between actors should be set up, and only after that the communication should be safe/reliable. In case of shutdown, "server" should notify "clients" about the shutdown and wait clients for "unsubscription" of the services, and only after that continue shutdown.

basiliscos commented 4 years ago

There is an idea to have holding reference class (i.e. it will do inc for the underlying in constructor and dec in destructor), which will be used only in appropriate places (i.e. as members in other actors). I.e.

auto server_address = hold(some_address);
basiliscos commented 4 years ago

seems no actual since v0.09 where linking solves the issue.

basiliscos commented 2 years ago

no longer actual in recent versions of rotor