TEC
A lightweight C++ library enabling safe, efficient execution in multithreaded and concurrent systems.
Loading...
Searching...
No Matches
tec_actor_worker.hpp File Reference

Template class combining Worker and Actor for synchronous request processing in a dedicated thread. More...

#include <cassert>
#include <memory>
#include <mutex>
#include "tec/tec_def.hpp"
#include "tec/tec_signal.hpp"
#include "tec/tec_status.hpp"
#include "tec/tec_trace.hpp"
#include "tec/tec_worker.hpp"
#include "tec/tec_actor.hpp"

Go to the source code of this file.

Classes

class  tec::ActorWorker< TParams, TActor >
 A Worker that owns and runs an Actor in a dedicated thread. More...
 
struct  tec::ActorWorker< TParams, TActor >::Builder< WorkerDerived, ActorDerived >
 Factory for constructing ActorWorker as a Daemon pointer. More...
 

Detailed Description

Template class combining Worker and Actor for synchronous request processing in a dedicated thread.

The tec::ActorWorker<TParams, TActor> class is a composite worker that:

  • Owns a concrete Actor instance.
  • Runs it in a dedicated thread.
  • Exposes synchronous request-reply processing via Payload.
  • Manages full lifecycle (startshutdown) with timeout-aware signals.

It bridges the asynchronous Actor interface with the synchronous Worker/Daemon model.

Template Parameters
TParamsParameter type (must derive from ActorParams or similar).
TActorConcrete actor type (must derive from tec::Actor).
Note
Thread-safe request handling via internal mutex.
See also
Worker, Actor, Daemon, Signal, Status
Author
The Emacs Cat
Date
2025-10-28