Skip to main content

behavior_actors/atomic/
mod.rs

1//! Atomic actor families with one independent behavior per aggregate.
2
3mod activation;
4mod capacity;
5mod diagnostic;
6mod drain;
7mod dynamic_supervisor;
8mod fifo_pool;
9mod fixed_supervisor;
10mod keyed_pool;
11mod pool;
12mod proxy_creation;
13mod restart;
14mod roster;
15mod schedule;
16mod stable_proxy;
17mod worker;
18
19pub use activation::{ActivationPolicy, EntryCapacity};
20/// Derive the one ordinary [`Behavior`](behavior::Behavior) implementation for a
21/// pool worker from its assignment transition.
22///
23/// The authored transition receives [`Assignment`] and completes it directly;
24/// the generated protocol and parent-completion request remain interpreter
25/// machinery rather than application syntax.
26///
27/// Omitting a required domain declaration is rejected at the attribute:
28///
29/// ```compile_fail
30/// struct Worker;
31/// #[behavior_actors::atomic::pool_worker(addr = behavior::MailAddr)]
32/// impl Worker {
33///     fn transition(&mut self, assignment: behavior_actors::atomic::Assignment<u8>) -> WorkerActed<Self> {
34///         Ok(behavior::Actions::cont().with_send(assignment.complete(10_u16)))
35///     }
36/// }
37/// ```
38///
39/// The transition must consume one assignment rather than an unrelated input:
40///
41/// ```compile_fail
42/// struct Worker;
43/// #[behavior_actors::atomic::pool_worker(addr = behavior::MailAddr, result = u16)]
44/// impl Worker {
45///     fn transition(&mut self, job: u8) -> WorkerActed<Self> {
46///         loop {}
47///     }
48/// }
49/// ```
50pub use behavior_macros::pool_worker;
51pub use capacity::ZeroCapacity;
52pub use diagnostic::DiagnosticDisposition;
53pub use diagnostic::{DiagnosticAccepted, DiagnosticAction, DiagnosticRoute};
54pub use drain::ActorDrainPolicy;
55pub use dynamic_supervisor::{
56    CancelAuthority, CancellationOutcome, CancellationReceipt, DynamicCommand, DynamicDiagnostic,
57    DynamicLifecycle, DynamicStatus, DynamicSupervisor, EntryRetirement, EntryStopFailure,
58    EntryStopFailureReason, InterruptedWorker, QueryReply, ReplaceRejection, ReplacementFailure,
59    StartRejection, StopRejection, UnexpectedExit, WorkerChange, WorkerChangeInterruption,
60    WorkerChangeReceipt, WorkerChangeRejection, dynamic,
61};
62#[doc(hidden)]
63pub use dynamic_supervisor::{DynamicSupervisorEvent, DynamicSupervisorRequests};
64pub use fifo_pool::{
65    AdmissionRejection, AssignedReturnReason, FifoCommand, FifoConstructionRejected, FifoError,
66    FifoEvent, FifoOutcome, FifoOutcomeKind, FifoPool, FifoRequests, QueuedReturnReason, fifo,
67};
68pub use fixed_supervisor::{
69    CapabilityResult, FailureReaction, FixedBuilder, FixedCommand, FixedConstructionRejected,
70    FixedDiagnostic, FixedLifecycle, FixedLifecycleEvent, FixedSnapshot, FixedSupervisor,
71    FixedSupervisorError, MemberStatus, ProxyInputFailure, ProxyOutcomeFailure, Recovery,
72    RecoveryDenialReason, RecoveryDenied, RestartScheduleFailure, Strategy, UnavailablePhase,
73    WorkerPreparationFailure, WorkerPreparationFailureReason, WorkerSource, WorkerUnavailable,
74    fixed,
75};
76#[doc(hidden)]
77pub use fixed_supervisor::{FixedLifecycleRoute, FixedSupervisorEvent, FixedSupervisorRequests};
78pub use fixed_supervisor::{PendingWorkerPreparation, PrepareWorkers, WorkerPreparation};
79pub use keyed_pool::{
80    BindingCapacity, BindingCommand, BindingEvidence, BindingExpectation, BindingGeneration,
81    BindingRejection, BindingReply, BindingRequestId, KeyedAdmissionRejection,
82    KeyedAssignedReturnReason, KeyedCommand, KeyedConstructionRejected, KeyedDiagnostic,
83    KeyedError, KeyedOutcome, KeyedPool, KeyedQueuedReturnReason, keyed,
84};
85#[doc(hidden)]
86pub use keyed_pool::{KeyedEvent, KeyedRequests};
87#[doc(hidden)]
88pub use pool::CompletesAssignments;
89pub use pool::CustomerDelivery;
90pub use pool::{AssignWorker, AssignmentReceipt};
91pub use pool::{
92    Assignment, BacklogCapacity, Completion, Interruption, JobId, PoolFailureReaction,
93    PoolRecovery, SubmissionId,
94};
95pub use restart::{RestartLimit, RestartRelease, RestartReleaseError, RestartReleaseFailure};
96pub(crate) use roster::RoleName;
97pub use roster::{DuplicateRole, OrderedRoles};
98#[doc(hidden)]
99pub use stable_proxy::ProxyEffects;
100pub(crate) use stable_proxy::ProxyOperationId;
101pub use stable_proxy::{
102    InitialWorkerOutcome, ProxyControlAdmission, ProxyDiagnostic, ProxyOutcome, ProxyPhase,
103    ReplacementOutcome, StableProxy,
104};
105pub use stable_proxy::{ProxyControl, ProxyInputReceipt, ProxyInputResult, ProxyOperation};
106pub use stable_proxy::{ProxyDrain, WorkerStartResult};
107pub use worker::{
108    ActivationPermit, ActivationStartRejection, BeginActivation, InitializationAttempt,
109    InitializeWorker, WorkerActivation, WorkerActivationGrant, WorkerInitializationOutcome,
110    WorkerInitializationReport,
111};
112pub use worker::{
113    ActivationPlan, ImmediateActivation, InitialWorkerRejection, PreparedWorker, WorkerAttempt,
114    WorkerCreationRejection, WorkerInitializationFailure, WorkerRecovery, WorkerSubmission,
115};
116pub use worker::{StartingWorkerPreparation, WorkerPreparationStarted};