Skip to main content

Module ractor

Module ractor 

Source

Modules§

actor
This module contains the basic building blocks of an actor.
concurrency
Shared concurrency primitives utilized within the library for different frameworks (tokio, async-std, etc)
errors
Actor error types
factory
Factory actors
macros
Macro helpers for remote procedure calls
message
Message trait definition for inter-actor messaging. Additionally with the cluster feature, it controls serialization logic for over-the-wire inter-actor communications
pg
Process groups (PG) are named groups of actors with a friendly name which can be used for retrieval of the process groups. Then within the group, either a random actor (for dispatch) can be selected or the whole group (broadcast), or a subset (partial-broadcast) can have a message sent to them. Common operations are to (a) upcast the group members to a strong-type’d actor then dispatch a message with crate::call or crate::cast.
port
Port implementations for signaling and reception of messages in the Ractor environment
registry
Represents an actor registry.
rpc
Remote procedure calls (RPC) are helpful communication primitives to communicate with actors
thread_local
The thread-local module provides support for managing tasks which are not Send safe, and must remain pinned to the same thread for their lifetime.
time
Timers for sending messages to actors periodically

Macros§

call
call!: Perform an infinite-time remote procedure call to an crate::Actor
call_t
call_t!: Perform an finite-time remote procedure call to an crate::Actor
cast
cast! takes an actor and a message and emits a crate::RactorErr error which can be pattern matched on in order to derive the output.
forward
forward!: Perform a remote procedure call to a crate::Actor and forwards the result to another actor if successful

Structs§

ActorCell
An ActorCell is a reference to an Actor’s communication channels and provides external access to send messages, stop, kill, and generally interactor with the underlying Actor process.
ActorRef
An ActorRef is a strongly-typed wrapper over an ActorCell to provide some syntactic wrapping on the requirement to pass the actor’s message type everywhere.
ActorRuntime
ActorRuntime is a struct which represents the processing actor.
DerivedActorRef
DerivedActorRef wraps an ActorCell to send messages that can be converted into its accepted type using From. DerivedActorRef allows to create isolation between actors by hiding the actual message type.
OutputPort
An OutputPort is a publish-subscribe mechanism for connecting actors together. It allows actors to emit messages without knowing which downstream actors are subscribed.
RpcReplyPort
A remote procedure call’s reply port. Wrapper of concurrency::OneshotSender with a consistent error type

Enums§

ActorErr
Actor processing loop errors
ActorId
An actor’s globally unique identifier
ActorStatus
ActorStatus represents the status of an actor’s lifecycle
MessagingErr
A messaging error has occurred
RactorErr
Error types which can result from Ractor processes
Signal
A signal message which takes priority above all else
SpawnErr
Spawn errors starting an actor
SupervisionEvent
A supervision event from the supervision tree

Constants§

ACTIVE_STATES
Actor states where operations can continue to interact with an agent

Traits§

Actor
Actor defines the behavior of an Actor. It specifies the Message type, State type, and all processing logic for the actor
Message
Message type for an actor. Generally an enum which muxes the various types of inner-messages the actor supports
OutputMessage
Output messages, since they need to be replicated, require Clone in addition to the base Message constraints
State
Represents the state of an actor. Must be safe to send between threads (same bounds as a Message)

Functions§

spawn
Perform a background-spawn of an actor. This is a utility wrapper over Actor::spawn which assumes the actor implementation implements Default.
spawn_local
Perform a background-spawn of an thread-local actor. This is a utility wrapper over thread_local::ThreadLocalActor::spawn which assumes the actor implementation implements Default.
spawn_named
Perform a background-spawn of an actor with the provided name. This is a utility wrapper over Actor::spawn which assumes the actor implementation implements Default.

Type Aliases§

ActorName
An actor’s name, equivalent to an Erlang atom()
ActorProcessingErr
Represents an actor’s internal processing error
GroupName
A process group’s name, equivalent to an Erlang atom()
ScopeName
A scope’s name, equivalent to an Erlang atom()

Attribute Macros§

async_trait