|
| | TActorSystem (TPollerBase *poller, int nodeId=1) |
| | Constructs the actor system.
|
| |
| TActorId | Register (IActor::TPtr actor) |
| | Registers an actor and returns its system-wide ID.
|
| |
|
auto | Sleep (TTime until) |
| | Suspends the current coroutine until until. Delegates to the poller.
|
| |
|
template<typename Rep , typename Period > |
| auto | Sleep (std::chrono::duration< Rep, Period > duration) |
| | Suspends the current coroutine for duration. Delegates to the poller.
|
| |
|
void | Send (TActorId sender, TActorId recipient, TMessageId messageId, TBlob blob) |
| | Low-level send with a pre-serialized blob. Prefer the typed Send<T> overload.
|
| |
| template<typename T , typename... Args> |
| void | Send (TActorId sender, TActorId recipient, Args &&... args) |
| | Sends a typed message from sender to recipient (non-blocking).
|
| |
|
TEvent | Schedule (TTime when, TActorId sender, TActorId recipient, TMessageId messageId, TBlob blob) |
| | Low-level schedule with a pre-serialized blob. Prefer the typed Schedule<T> overload.
|
| |
| template<typename T , typename... Args> |
| TEvent | Schedule (TTime when, TActorId sender, TActorId recipient, Args &&... args) |
| | Schedules a typed message to be delivered at when.
|
| |
| void | Cancel (TEvent event) |
| | Cancels a previously scheduled message.
|
| |
| template<typename T , typename TQuestion > |
| auto | Ask (TActorId recepient, TQuestion &&message) |
| | Sends a request and returns an awaitable for the reply of type T.
|
| |
| void | YieldNotify () |
| | Wakes up the internal scheduler to process newly ready nodes.
|
| |
|
size_t | ActorsSize () const |
| | Returns the number of currently registered (alive) actors.
|
| |
| void | AddNode (int id, std::unique_ptr< INode > node) |
| | Registers a remote node for distributed message routing.
|
| |
| void | Serve () |
| | Starts the actor system event loop for local actors only.
|
| |
| template<typename TSocket , typename TEnvelopeReader = TZeroCopyEnvelopeReader> |
| void | Serve (TSocket socket) |
| | Starts the actor system with inbound and outbound network serving.
|
| |
Single-threaded actor runtime.
Manages actor registration, message delivery, timers, and (optionally) distributed communication over TCP. All actors run on the single thread that drives the poller — no locking is required inside handlers.
Local-only setup:
auto id = sys.Register(std::make_unique<MyActor>());
sys.Send<StartMsg>(id, id);
sys.Serve();
Single-threaded actor runtime.
Definition actorsystem.hpp:99
Event loop that drives a poller backend.
Definition loop.hpp:30
TPoller & Poller()
Provides access to the underlying poller instance.
Definition loop.hpp:57
void Loop()
Runs the main loop until Stop() is called.
Definition loop.hpp:35
Distributed setup — call AddNode for each peer, then Serve(socket):
sys.Serve(std::move(listeningSocket));
Concrete INode implementation for a single remote actor-system endpoint.
Definition node.hpp:61
A class representing an IPv4 or IPv6 address (with port).
Definition address.hpp:38