Skip to main content

Crate coactor

Crate coactor 

Source
Expand description

Embedded distributed Actor framework for Rust applications.

CoActor addresses logical Actors with a validated ActorAddress, hosts them in a Server, and lets callers communicate through bidirectional Sessions opened by a Client. Actions and Events are byte messages with in-memory, at-most-once delivery semantics.

Availability failover starts a replacement Active Actor with empty CoActor-managed state.

Start with the repository’s Getting Started guide.

Modules§

coordination
test_support

Structs§

ActorAddress
A validated, reusable Actor address.
ActorConfig
Per-Actor-Type runtime policy overrides.
ActorRuntime
Runtime capabilities provided when an Active Actor is constructed.
Client
Caller runtime that directly resolves and connects to Actor Owners.
ClientBuilder
Builds a caller-only Client from read-only Coordination capabilities.
MessageContext
Read-only context for processing one Action.
P2cPlacement
默认:p2c 均衡放置 + in-flight 记账。
PlacementCandidate
候选节点:端点 + 负载快照(Load Ratio = active/max 的输入)。
PlacementContext
放置决策上下文:runtime 已硬过滤后的候选节点(Load Ratio 输入)。
Server
Entry point for configuring and serving a production Actor Server.
ServerBuilder
Builder for a production Server.
Session
A caller-side Session for sending Actions and receiving Events.
SessionHandle
Actor 侧持有的 Session 出站句柄:向该 Session 的 caller 定向推送 Event。 非泛型:仅引用注册表 + 地址 + Session ID。
SessionId
本节点 Session 接收流的容量(出站 Event 背压上界)。 Session 的唯一标识,由 caller 建立 Session 时生成。

Enums§

ActorAddressError
ClientBuildError
DeactivationReason
OpenError
RemoteProtocolError
SendError
ServerError

Traits§

Actor
The consumer-defined Actor contract.
IntoActorConfig
PlacementStrategy
返回有序候选;空列表表示当前没有可尝试的 Server。

Attribute Macros§

actor