Actor that delegates message handling to a pluggable behavior. More...
#include <actor.hpp>
Public Member Functions | |
void | Become (IBehavior *behavior) |
Switch to a new behavior. | |
void | Receive (TMessageId messageId, TBlob blob, TActorContext::TPtr ctx) override |
Delegate message handling to the current behavior. | |
Additional Inherited Members | |
![]() | |
using | TPtr = std::unique_ptr< IActor > |
Actor that delegates message handling to a pluggable behavior.
IBehaviorActor allows actors to change their message handling behavior dynamically at runtime. This is useful for implementing state machines, protocol handlers, or any actor that needs to change its behavior based on its current state.
Usage example:
|
inline |
|
inlineoverridevirtual |
Delegate message handling to the current behavior.
messageId | Type identifier of the message |
blob | Serialized message data |
ctx | Actor context for communication |
Implements NNet::NActors::IActor.