rotor
Event loop friendly C++ actor micro-framework
 
Loading...
Searching...
No Matches
rotor::spawner_t Struct Reference

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
 

Detailed Description

allows automatically restart actors

Spawner will NOT create new actor instances when supervisor is SHUTTING_DOWN or SHUT_DOWN.

Member Function Documentation

◆ escalate_failure()

spawner_t && rotor::spawner_t::escalate_failure ( bool  = true)
noexcept

shutdown actor when the spawned actor crashed

The actor "crash" means actor terminated with non-zero error code.

◆ max_attempts()

spawner_t && rotor::spawner_t::max_attempts ( size_t  )
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.

◆ restart_period()

spawner_t && rotor::spawner_t::restart_period ( const pt::time_duration &  )
noexcept

minimum amount of time before respawning new actor

Default value is 15 seconds.


The documentation for this struct was generated from the following file: