14#pragma warning(disable : 4251)
20enum class request_state_t { NONE, SENT, CONFIRMED };
30struct ROTOR_API spawner_t {
65 spawner_t(
factory_t factory, supervisor_t &supervisor) noexcept;
68 supervisor_t &supervisor;
69 pt::time_duration period = pt::seconds{15};
73 bool escalate =
false;
Basic namespace for all rotor functionalities.
Definition rotor.hpp:21
std::function< actor_ptr_t(supervisor_t &, const address_ptr_t &)> factory_t
factory which allows to create actors lazily or on demand
Definition forward.hpp:45
restart_policy_t
spawner's actor restart policy
Definition policy.h:23
@ normal_only
restart actor only when it terminated normally (without error)
Definition policy.h:35
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
void spawn() noexcept
sends a message to supervisor to spawn the new actor instance
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
supervisor is responsible for managing actors (workers) lifetime
Definition supervisor.h:68