rotor
Event loop friendly C++ actor micro-framework
 
Loading...
Searching...
No Matches
supervisor_thread.h
1#pragma once
2
3//
4// Copyright (c) 2019-2022 Ivan Baidakou (basiliscos) (the dot dmol at gmail dot com)
5//
6// Distributed under the MIT Software License
7//
8
9#include "rotor/supervisor.h"
10#include "rotor/thread/export.h"
11#include "system_context_thread.h"
12
13namespace rotor {
14namespace thread {
15
24struct ROTOR_THREAD_API supervisor_thread_t : public supervisor_t {
27
28 void start() noexcept override;
29 void shutdown() noexcept override;
30 void enqueue(message_ptr_t message) noexcept override;
31 void intercept(message_ptr_t &message, const void *tag, const continuation_t &continuation) noexcept override;
32
34 void update_time() noexcept;
35
36 void do_start_timer(const pt::time_duration &interval, timer_handler_base_t &handler) noexcept override;
37 void do_cancel_timer(request_id_t timer_id) noexcept override;
38};
39
40} // namespace thread
41} // namespace rotor
Basic namespace for all rotor functionalities.
Definition rotor.hpp:21
intrusive_ptr_t< message_base_t > message_ptr_t
intrusive pointer for message
Definition message.h:118
std::size_t request_id_t
timer identifier type in the scope of the actor
Definition forward.hpp:34
continue handler invocation (used for intercepting)
Definition handler.h:175
base supervisor config, which holds shutdown timeout value
Definition supervisor_config.h:23
supervisor is responsible for managing actors (workers) lifetime
Definition supervisor.h:69
pure thread supervisor dedicated for blocking I/O or computing operations
Definition supervisor_thread.h:24
void start() noexcept override
thread-safe version of do_process
supervisor_thread_t(supervisor_config_t &cfg)
constructs new thread supervisor
Definition supervisor_thread.h:26
Base class for timer handler.
Definition timer_handler.hpp:17