11#include "actor_config.h"
15#pragma warning(disable : 4251)
74 using builder_t =
typename Supervisor::template config_builder_t<Supervisor>;
79 using parent_t::parent_t;
109 return std::move(*
static_cast<builder_t *
>(
this));
115 return std::move(*
static_cast<builder_t *
>(
this));
131 return std::move(*
static_cast<builder_t *
>(
this));
Basic namespace for all rotor functionalities.
Definition rotor.hpp:21
intrusive_ptr_t< address_t > address_ptr_t
intrusive pointer for address
Definition address.hpp:57
supervisor_policy_t
how to behave on child actor initialization failures
Definition policy.h:12
@ shutdown_self
shutdown supervisor (and all its actors) if a child-actor fails during supervisor initialization phas...
CRTP actor config builder.
Definition actor_config.h:92
virtual bool validate() noexcept
checks whether config is valid, i.e. all necessary fields are set
Definition actor_config.h:197
config_t config
the currently build config
Definition actor_config.h:128
typename Actor::template config_builder_t< Supervisor > builder_t
final builder class
Definition actor_config.h:94
basic actor configuration: init and shutdown timeouts, etc.
Definition actor_config.h:62
actor_config_t(supervisor_t *supervisor_)
constructs actor_config_t from raw supervisor pointer
Definition actor_config.h:88
CRTP supervisor config builder.
Definition supervisor_config.h:72
builder_t && policy(supervisor_policy_t policy_) &&noexcept
defines actor's startup policy
Definition supervisor_config.h:82
builder_t && create_registry(bool value=true) &&noexcept
instructs supervisor to create an registry
Definition supervisor_config.h:88
virtual bool validate() noexcept
checks whether config is valid, i.e. all necessary fields are set
Definition supervisor_config.h:134
builder_t && inbound_queue_size(size_t value) &&
initial queue size for inbound messages. Makes sense only for root/leader supervisor
Definition supervisor_config.h:107
builder_t && registry_address(const address_ptr_t &value) &&noexcept
injects external registry address
Definition supervisor_config.h:100
typename Supervisor::template config_builder_t< Supervisor > builder_t
final builder class
Definition supervisor_config.h:74
builder_t && shutdown_flag(const std::atomic_bool &value, const pt::time_duration &interval) &&
atomic shutdown flag and the period for polling it
Definition supervisor_config.h:128
builder_t && synchronize_start(bool value=true) &&noexcept
instructs supervisor to synchronize start on it's children actors
Definition supervisor_config.h:94
builder_t && poll_duration(const pt::time_duration &value) &&
how much time spend in active inbound queue polling
Definition supervisor_config.h:113
base supervisor config, which holds shutdown timeout value
Definition supervisor_config.h:23
size_t inbound_queue_size
initial queue size for inbound messages. Makes sense only for root/leader supervisor
Definition supervisor_config.h:46
pt::time_duration shutdown_poll_frequency
the period for checking atomic shutdown flag
Definition supervisor_config.h:68
const std::atomic_bool * shutdown_flag
pointer to atomic shutdown flag for polling (optional)
Definition supervisor_config.h:65
address_ptr_t registry_address
use the specified address of a registry
Definition supervisor_config.h:42
bool create_registry
whether the registry actor should be instantiated by supervisor
Definition supervisor_config.h:31
bool synchronize_start
whether supervisor should wait until all actors confirmed initialization, and only then send start si...
Definition supervisor_config.h:35
supervisor_policy_t policy
how to behave if child-actor fails
Definition supervisor_config.h:28
pt::time_duration poll_duration
How much time it will spend in polling inbound queue before switching into sleep mode (i....
Definition supervisor_config.h:57