Expand description
This modules defines a set of common message types used for managing resources in hyperactor meshes.
§Rank-status positioning (RSP-*)
Status queries (GetRankStatus, WaitRankStatus) reply with a
StatusOverlay — a sparse, rank-indexed patch the caller merges into an
accumulator over its own view. Positioning that overlay is the contract this
registry names; each invariant is cited at the sites that must uphold it.
- RSP-1 — an overlay is positioned at the recipient’s dense rank in the consuming view (the one the caller accumulates over), never the rank the resource was first created under. Reusing the creation rank mis-attributes or drops the reply over a renumbered or sliced view.
- RSP-2 — the positioning rank travels as the
Rankmessage field. Cast sites leave itRank::default()and the cast layer late-binds it in transit with the delivered dense rank; direct (non-cast) delivery supplies it explicitly withRank::new(view_rank). - RSP-3 — a deferred waiter (a
WaitRankStatusbelow its threshold, or one registered before its resource exists) retains its registration rank until it is flushed; the flush never rewrites it to a creation rank. - RSP-4 — when a handler reports absence immediately, it returns an
empty overlay; the message’s
Rankis never overloaded as an absence signal.WaitRankStatusmay instead defer when later creation is expected (RSP-3), replying once the resource exists.
ActorState streaming supervision must satisfy the analogous positioning
contract; extending this registry to cover ActorState is future work.
Modules§
- mesh
- This module defines common types for mesh resources. Meshes are managed as
resources, usually by a controller actor implementing the
crate::resourcebehavior.
Structs§
- Controller
- The generated behavior struct.
- Create
OrUpdate - Create or update a resource according to a spec.
- GetRank
Status - Get the status of a resource.
- GetState
- Retrieve the current state of the resource.
- Keepalive
GetState - Same as GetState, but additionally tells the receiver that the owner is still alive. If the receiver does not receive this message for a while, it might assume the owner is dead.
- List
- List the set of resources managed by the controller.
- Rank
- Data type used to communicate ranks. Serialized as a typed multipart part so comm actors can replace instances with the delivered rank while the message is in transit.
- Rank
Repr - Serialized representation for
Rankmultipart parts. - Ranked
State - A state update positioned in the subscriber’s current view.
- Ranked
Values - RankedValues compactly represents rank-indexed values of type T. It stores contiguous values in a set of intervals; thus it is efficient and compact when the cardinality of T-typed values is low.
- State
- The state of a resource.
- Stop
- Stop a resource according to a spec.
- StopAll
- Stop all resources owned by the receiver of this message. No reply, this just issues the stop command. Use GetRankStatus to determine if it has successfully stopped.
- Stream
State - Subscribe to streaming state updates for a named resource.
The subscriber port will receive
RankedState<S>whenever the resource’s state changes. The current state is sent immediately upon subscription. - Values
ByRank - An inverted index of RankedValues, providing all ranks for which each unique T-typed value appears.
- Wait
Rank Status - Like
GetRankStatus, but the handler defers its reply until the resource’s status is >=min_status. This avoids the race where the caller seesStoppingbefore the process has actually exited.
Enums§
- Status
- The current lifecycle status of a resource.
Traits§
- Create
OrUpdate Client - The custom client trait for this message type.
- Create
OrUpdate Handler - The custom handler trait for this message type.
- GetRank
Status Client - The custom client trait for this message type.
- GetRank
Status Handler - The custom handler trait for this message type.
- GetState
Client - The custom client trait for this message type.
- GetState
Handler - The custom handler trait for this message type.
- Keepalive
GetState Client - The custom client trait for this message type.
- Keepalive
GetState Handler - The custom handler trait for this message type.
- List
Client - The custom client trait for this message type.
- List
Handler - The custom handler trait for this message type.
- Ranked
State Client - The custom client trait for this message type.
- Ranked
State Handler - The custom handler trait for this message type.
- Resource
- A trait that bundles a set of types that together define a resource.
- State
Client - The custom client trait for this message type.
- State
Handler - The custom handler trait for this message type.
- Stop
AllClient - The custom client trait for this message type.
- Stop
AllHandler - The custom handler trait for this message type.
- Stop
Client - The custom client trait for this message type.
- Stop
Handler - The custom handler trait for this message type.
- Stream
State Client - The custom client trait for this message type.
- Stream
State Handler - The custom handler trait for this message type.
- Wait
Rank Status Client - The custom client trait for this message type.
- Wait
Rank Status Handler - The custom handler trait for this message type.
Functions§
- wait_
mesh - Collect an accumulated
ValueMesh<T>fromrxuntil every rank has been reported ormax_idle_timeelapses with no update.