Skip to main content

aion_server/worker/
mod.rs

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