Skip to main content

aion_server/worker/
mod.rs

1//! Module declarations.
2
3/// Whether a contract refusal is new information, and therefore worth saying.
4pub mod admission_audit;
5/// Per-tenant keyed backpressure at the outbox claim (Control-Plane Phase 2,
6/// P2-Q2).
7pub mod backpressure;
8/// Bridge from engine activity dispatch to connected workers.
9pub mod bridge;
10/// Worker contract admission shared by every registration transport.
11pub mod contracts;
12/// Server-side execution of declared action bodies (no worker required).
13pub mod declared_body;
14/// The refusal, and the followable remedy, for retained versions that declare
15/// different bodies for one action.
16pub mod declared_body_ambiguity;
17/// Which retained version's body a declared-command dispatch runs — the
18/// dispatching run's own, not the queue's.
19pub mod declared_body_selection;
20/// Activity completion handling and dispatch abstractions.
21pub mod dispatch;
22/// Task-envelope generation, idempotency keys, and completion fencing.
23pub mod envelope;
24/// Worker heartbeat and liveness tracking.
25pub mod heartbeat;
26/// Server-side mid-run intervention routing (NOI-6): capability gate + attempt
27/// owner resolution + push to the owning worker over a pluggable transport.
28pub mod intervention;
29/// Server half of the liminal connection dead-man switch: the liveness ping/pong
30/// wire pair and the probe that keeps a healthy idle connection's lease alive
31/// while making a dead one loud on both sides.
32#[cfg(feature = "liminal-transport")]
33pub mod liminal_liveness;
34/// Cross-node outbox dispatch over the liminal bus (#13-0 spike, feature-gated).
35#[cfg(feature = "liminal-transport")]
36pub mod liminal_transport;
37/// The outbox dead-letter path: retire the row, tell the workflow, record whether it was told.
38pub(crate) mod outbox_dead_letter;
39/// Server-side outbox completion delivery into live workflows.
40pub mod outbox_delivery;
41/// Non-replayed durable-outbox fan-out dispatcher (dormant unless commissioned).
42pub mod outbox_dispatcher;
43/// Live stale-claim outbox reconciler (dormant unless commissioned).
44pub mod outbox_reconciler;
45/// Operator-driven redrive of dead-lettered outbox rows, gated on workflow liveness and on
46/// whether the dead letter's failure was already judged.
47pub mod outbox_redrive;
48/// Terminal-workflow outbox settlement sweep for boot and shard adoption (#253).
49pub mod outbox_settle;
50/// Short-TTL per-namespace placement cache for the dispatcher (Control-Plane
51/// Phase 2, P2-P3).
52pub mod placement_cache;
53/// Unserved-queue honesty at the bridge seam (R1): the four-way taxonomy,
54/// service policies, the two service clocks, and the queryable queue state.
55pub mod queue_service;
56/// Throttled per-namespace quota-state broadcaster for the ops-console live badge
57/// (Control-Plane Phase 2, P2-Q3).
58pub mod quota_broadcast;
59/// Short-TTL per-namespace concurrency-quota cache for the dispatcher's keyed
60/// backpressure (Control-Plane Phase 2, P2-Q2).
61pub mod quota_cache;
62/// Connected-worker registry and handles.
63pub mod registry;
64/// Transport-domain classification and re-dispatch budget for activities whose
65/// worker died before reporting a result.
66pub mod transport_loss;
67/// Server-side `{workspace_root}` expansion for declared action bodies (#139).
68pub mod workspace_root;
69
70pub use admission_audit::AdmissionAudit;
71pub use backpressure::{Backpressure, OwnedShardFraction};
72pub use bridge::{OutboxDeliveryCallback, PendingActivities, WorkerActivityDispatcher};
73pub use declared_body::{
74    DeclaredBodies, DeclaredBodyLookup, DeclaredBodySource, DeclaredCommandDispatcher,
75    DispatchingRun, EngineDeclaredBodies,
76};
77pub use declared_body_ambiguity::{DeclaringVersion, ambiguous_body_refusal};
78pub use declared_body_selection::select_declared_body;
79pub use dispatch::{
80    ActivityCompletion, ActivityCompletionOutcome, ActivityCompletionSink, ActivityDispatcher,
81    ScheduledActivity, handle_activity_result,
82};
83pub use envelope::{CompletionFences, CompletionToken, idempotency_key};
84pub use heartbeat::{
85    HeartbeatSweeper, HeartbeatTracker, HeartbeatUpdate, InFlightActivity, LostWorkerReport,
86    TaskLiveness, sweep_interval,
87};
88pub use intervention::{AttemptKey, AttemptOwnerIndex, InterventionRouter, InterventionTransport};
89#[cfg(feature = "liminal-transport")]
90pub use liminal_liveness::{LivenessPing, LivenessPong, LivenessProbe, LivenessTarget};
91#[cfg(feature = "liminal-transport")]
92pub use liminal_transport::{
93    DispatchRequest, DispatchResponse, InterventionReply, InterventionRequest,
94    LiminalCompletionSource, LiminalConnectionNotifier, LiminalInterventionTransport,
95    LiminalWorkerDelivery, RegistryLiminalDispatch, channel_for_row, dispatch_channel_name,
96};
97pub use outbox_delivery::ServerOutboxDeliveryCallback;
98pub use outbox_dispatcher::{
99    DeliveryGate, OutboxDispatcher, OutboxDispatcherConfig, OutboxRowDispatch, WorkerOutboxDispatch,
100};
101pub use outbox_reconciler::{OutboxReconciler, OutboxReconcilerConfig};
102pub use outbox_redrive::{RedriveRefused, list_dead_letters, redrive_dead_lettered_row};
103pub use outbox_settle::settle_terminal_outbox_rows;
104pub use placement_cache::{
105    PlacementCache, WorkerSelection, preferred_node_order, worker_selection_for,
106};
107pub use queue_service::{
108    ActivityReachability, DeliveryRefusal, EngineQueueDeclarations, ExpiredClock, OpenActivity,
109    PoolCensus, QueueDeclaration, QueueDeclarationSource, QueueDeclarations, QueueServiceConfig,
110    QueueServiceOverride, QueueServicePolicy, QueueServiceReason, QueueServiceState,
111    ServiceAddress, UnavailableSummary, UnservedDispatch, UnservedKey, UnservedQueue,
112    WorkerUnavailable, open_activities_in_active_segment,
113};
114pub use quota_broadcast::QuotaBroadcaster;
115pub use quota_cache::QuotaCache;
116pub use registry::{
117    ConnectedWorkerRegistry, WorkerDelivery, WorkerHandle, WorkerId, WorkerRegistration,
118};
119pub use transport_loss::{
120    TRANSPORT_EXHAUSTED_REASON_PREFIX, TRANSPORT_LOSS_BUDGET_WINDOWS, TransportLossLedger,
121    TransportLossVerdict, WORKER_LOST_REASON_PREFIX, is_transport_domain_reason,
122    worker_lost_detail,
123};
124pub use workspace_root::{
125    ExpandedCommand, WORKSPACE_ROOT_PLACEHOLDER, WorkspaceRoot, WorkspaceRootError,
126};