Base interface for all actors in the system. More...
#include <actor.hpp>
Public Types | |
using | TPtr = std::unique_ptr< IActor > |
Public Member Functions | |
virtual void | Receive (TMessageId messageId, TBlob blob, TActorContext::TPtr ctx)=0 |
Process an incoming message. | |
Friends | |
class | TActorSystem |
Base interface for all actors in the system.
IActor defines the basic contract that all actors must implement. Actors receive messages through the Receive method and can respond by sending messages back through the provided context.
This is the synchronous version of actor interface - the Receive method should complete quickly and not block on I/O operations.
|
pure virtual |
Process an incoming message.
messageId | Type identifier of the message |
blob | Serialized message data |
ctx | Actor context for sending responses and accessing actor system |
This method should process the message quickly and not perform blocking operations. For async operations, use ICoroActor instead.
Implemented in NNet::NActors::ICoroActor, NNet::NActors::IBehaviorActor, and NNet::NActors::TAsk< T >.