allows automatically restart actors More...
#include <spawner.h>
Public Member Functions | |
spawner_t && | restart_period (const pt::time_duration &) noexcept |
minimum amount of time before respawning new actor | |
spawner_t && | restart_policy (restart_policy_t) noexcept |
determines whether new actor instance should be spawned | |
spawner_t && | max_attempts (size_t) noexcept |
maximum amount of spawned actor instances | |
spawner_t && | escalate_failure (bool=true) noexcept |
shutdown actor when the spawned actor crashed | |
void | spawn () noexcept |
sends a message to supervisor to spawn the new actor instance | |
Friends | |
struct | supervisor_t |
allows automatically restart actors
Spawner will NOT create new actor instances when supervisor is SHUTTING_DOWN or SHUT_DOWN.
|
noexcept |
shutdown actor when the spawned actor crashed
The actor "crash" means actor terminated with non-zero error code.
|
noexcept |
maximum amount of spawned actor instances
The default value is 0
, which means try new restart attempt if that is allowed by the policy.
|
noexcept |
minimum amount of time before respawning new actor
Default value is 15 seconds.