COROIO: NNet::NActors::ICoroActor Class Reference
COROIO
 
Loading...
Searching...
No Matches
NNet::NActors::ICoroActor Class Referenceabstract

Coroutine-based actor interface for asynchronous message processing. More...

#include <actor.hpp>

Inheritance diagram for NNet::NActors::ICoroActor:
NNet::NActors::IActor

Public Member Functions

void Receive (TMessageId messageId, TBlob blob, TActorContext::TPtr ctx) override
 Synchronous receive method (calls CoReceive internally)
 
virtual TFuture< void > CoReceive (TMessageId messageId, TBlob blob, TActorContext::TPtr ctx)=0
 Asynchronous message processing method.
 

Additional Inherited Members

- Public Types inherited from NNet::NActors::IActor
using TPtr = std::unique_ptr< IActor >
 

Detailed Description

Coroutine-based actor interface for asynchronous message processing.

ICoroActor extends IActor to support asynchronous message processing using coroutines. The CoReceive method can perform async operations like sleeping, waiting for responses, or doing I/O without blocking the actor system.

Member Function Documentation

◆ CoReceive()

virtual TFuture< void > NNet::NActors::ICoroActor::CoReceive ( TMessageId  messageId,
TBlob  blob,
TActorContext::TPtr  ctx 
)
pure virtual

Asynchronous message processing method.

Parameters
messageIdType identifier of the message
blobSerialized message data
ctxActor context for communication
Returns
Future that completes when message processing is done

This method can use co_await to perform asynchronous operations without blocking the actor system thread.

◆ Receive()

void NNet::NActors::ICoroActor::Receive ( TMessageId  messageId,
TBlob  blob,
TActorContext::TPtr  ctx 
)
overridevirtual

Synchronous receive method (calls CoReceive internally)

Parameters
messageIdType identifier of the message
blobSerialized message data
ctxActor context for communication

Implements NNet::NActors::IActor.


The documentation for this class was generated from the following files: