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

base supervisor config, which holds shutdown timeout value More...

#include <supervisor_config.h>

Inheritance diagram for rotor::supervisor_config_t:
rotor::actor_config_t rotor::asio::supervisor_config_asio_t rotor::ev::supervisor_config_ev_t rotor::wx::supervisor_config_wx_t

Public Member Functions

 actor_config_t (supervisor_t *supervisor_)
 constructs actor_config_t from raw supervisor pointer
 
- Public Member Functions inherited from rotor::actor_config_t
 actor_config_t (supervisor_t *supervisor_)
 constructs actor_config_t from raw supervisor pointer
 

Public Attributes

supervisor_policy_t policy = supervisor_policy_t::shutdown_self
 how to behave if child-actor fails
 
bool create_registry = false
 whether the registry actor should be instantiated by supervisor
 
bool synchronize_start = false
 whether supervisor should wait until all actors confirmed initialization, and only then send start signal to all of them
 
address_ptr_t registry_address
 use the specified address of a registry
 
size_t inbound_queue_size = 64
 initial queue size for inbound messages. Makes sense only for root/leader supervisor
 
pt::time_duration poll_duration = pt::millisec{1}
 How much time it will spend in polling inbound queue before switching into sleep mode (i.e. waiting external messages).
 
const std::atomic_bool * shutdown_flag = nullptr
 pointer to atomic shutdown flag for polling (optional)
 
pt::time_duration shutdown_poll_frequency = pt::millisec{100}
 the period for checking atomic shutdown flag
 
- Public Attributes inherited from rotor::actor_config_t
plugins_constructor_t plugins_constructor
 constructs plugin_storage_ptr_t
 
supervisor_tsupervisor
 raw pointer to supervisor_t
 
pt::time_duration init_timeout
 max actor initialization time
 
pt::time_duration shutdown_timeout
 max actor shutdown time
 
address_ptr_t spawner_address
 address of the spawner
 
bool escalate_failure = false
 shutdown supervisor upon child failure
 
bool autoshutdown_supervisor = false
 shutdown supervisor upon child down
 

Additional Inherited Members

- Public Types inherited from rotor::actor_config_t
using plugins_constructor_t = std::function< plugin_storage_ptr_t()>
 constructs plugin_storage_ptr_t (type)
 

Detailed Description

base supervisor config, which holds shutdown timeout value

Member Data Documentation

◆ poll_duration

pt::time_duration rotor::supervisor_config_t::poll_duration = pt::millisec{1}

How much time it will spend in polling inbound queue before switching into sleep mode (i.e. waiting external messages).

This value might affect I/O latency on event-loops, so set it to zero to minimizer I/O latency on event-loops by the rising cross-thread rotor messaging latency.

◆ registry_address

address_ptr_t rotor::supervisor_config_t::registry_address

use the specified address of a registry

Can be useful if an registry was created on the different supervisors hierarchy

◆ shutdown_flag

const std::atomic_bool* rotor::supervisor_config_t::shutdown_flag = nullptr

pointer to atomic shutdown flag for polling (optional)

When it is set, supervisor will periodically check that the flag is set and then shut self down.


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