Skip to main content

Module actor

Module actor 

Source
Expand description

Core actor traits and types (Actor, ActorRef, Handler, etc.).

Structs§

ActorContext
Context passed to actor lifecycle hooks and handlers.
ActorError
An error originating from within an actor’s handler or lifecycle hook.
AskReply
A future that resolves to the reply from an ask() call.
SpawnConfig
Configuration for spawning an actor.

Traits§

Actor
The core actor trait. Implemented by the user’s actor struct. State lives in self. Lifecycle hooks have default no-ops.
ActorRef
A reference to a running actor of type A.
ExpandHandler
Implemented by actors that handle expand (server-streaming) requests. The handler receives the request and a StreamSender to push items into. When this method returns, the stream closes on the caller side.
Handler
Implemented by an actor for each message type it can handle. One impl per (Actor, Message) pair. Sequential execution guaranteed.
ReduceHandler
Implemented by actors that handle reduce (client-streaming) requests.
TransformHandler
Implemented by actors that handle transform (N→M) requests.

Functions§

cancel_after
Create a CancellationToken that automatically cancels after the given duration.