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

The thread system context, for blocking operations. More...

#include <system_context_thread.h>

Inheritance diagram for rotor::thread::system_context_thread_t:
rotor::system_context_t

Classes

struct  deadline_info_t
 struct to keep timer handlers More...
 

Public Member Functions

 system_context_thread_t () noexcept
 constructs thread system context
 
virtual void run () noexcept
 invokes blocking execution of the supervisor
 
void check () noexcept
 checks for messages from external threads and fires expired timers
 
- Public Member Functions inherited from rotor::system_context_t
template<typename Supervisor = supervisor_t>
auto create_supervisor ()
 returns builder for root supervisor
 
supervisor_ptr_t get_supervisor () noexcept
 returns root supervisor
 
 system_context_t (const system_context_t &)=delete
 
 system_context_t (system_context_t &&)=delete
 
virtual void on_error (actor_base_t *actor, const extended_error_ptr_t &ec) noexcept
 fatal error handler
 
virtual std::string identity () noexcept
 identifies the context.
 
template<typename T >
auto & access () noexcept
 generic non-public fields accessor
 
const message_stringifier_tget_stringifier ()
 returns the default stringifier
 

Protected Types

using clock_t = std::chrono::steady_clock
 an alias for monotonic clock
 
using list_t = std::list< deadline_info_t >
 ordered list of deadline infos (type)
 

Protected Member Functions

void update_time () noexcept
 fires handlers for expired timers
 
void start_timer (const pt::time_duration &interval, timer_handler_base_t &handler) noexcept
 start timer implementation
 
void cancel_timer (request_id_t timer_id) noexcept
 cancel timer implementation
 
- Protected Member Functions inherited from rotor::system_context_t
virtual message_stringifier_ptr_t make_stringifier () const noexcept
 constructs message stringifier
 

Protected Attributes

std::mutex mutex
 mutex for inbound queue
 
std::condition_variable cv
 cv for notifying about pushing messages into inbound queue
 
clock_t::time_point now
 current time
 
list_t timer_nodes
 ordered list of deadline infos
 
bool intercepting = false
 whether the context is intercepting blocking (I/O) handler
 

Friends

struct supervisor_thread_t
 

Detailed Description

The thread system context, for blocking operations.

Member Function Documentation

◆ run()

virtual void rotor::thread::system_context_thread_t::run ( )
virtualnoexcept

invokes blocking execution of the supervisor

It blocks until root supervisor shuts down.


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