Expand description
Runtime substrate for the RocketMQ Rust unified thread model.
This crate standardizes how components own or borrow a Tokio runtime, how
they derive service-level task scopes through RootServiceContext and
ChildServiceContext, how
TaskGroup and ScheduledTaskGroup track long-running and periodic
tasks, how BlockingExecutor isolates short blocking work, and how
ShutdownReport records verifiable shutdown evidence.
Process entrypoints own RuntimeOwner and derive a single
RootServiceContext. Production libraries receive a
ChildServiceContext or a narrower capability. [RuntimeContext] is a
test and migration harness.
prelude documents the recommended entry path with an example that runs
as a test.
Re-exports§
pub use blocking::BlockingExecutorSnapshot;pub use blocking::BlockingKind;pub use blocking::BlockingLane;pub use blocking::BlockingLanePolicies;pub use blocking::BlockingPoolPolicy;pub use blocking::BlockingTaskSnapshot;pub use resource_budget::BudgetCapacity;pub use resource_budget::BudgetClass;pub use resource_budget::BudgetDimension;pub use resource_budget::BudgetLimit;pub use resource_budget::BudgetRejection;pub use resource_budget::BudgetRejectionReason;pub use resource_budget::BudgetSnapshot;pub use resource_budget::BudgetedItem;pub use resource_budget::BudgetedQueue;pub use resource_budget::DynamicBudgetKey;pub use resource_budget::DynamicKeyAdmissionRejection;pub use resource_budget::DynamicKeyRegistrationFailure;pub use resource_budget::DynamicKeyRetirement;pub use resource_budget::ForeignPermit;pub use resource_budget::FullPolicy;pub use resource_budget::HostMemoryFileView;pub use resource_budget::ManagedMemoryBudget;pub use resource_budget::ManagedMemoryPolicy;pub use resource_budget::ManagedMemoryRequest;pub use resource_budget::MemoryFileView;pub use resource_budget::MemoryLimitSource;pub use resource_budget::MonotonicClock;pub use resource_budget::PermitRebindOutcome;pub use resource_budget::ProcessMemoryLimit;pub use resource_budget::QueuePushOutcome;pub use resource_budget::QueuePushRejection;pub use resource_budget::QueueSnapshot;pub use resource_budget::RateLimit;pub use resource_budget::ResourceBudgetTree;pub use resource_budget::ResourcePermit;pub use resource_budget::SystemMonotonicClock;pub use service_context::ScopeId;pub use shutdown_report::ShutdownAnnotation;pub use shutdown_report::TaskSnapshot;pub use signal::wait_for_signal;pub use signal::wait_for_signal_result;pub use task_group::TaskGroupEventCounts;pub use task_group::TaskGroupId;pub use task_group::TaskGroupLifecycleState;pub use task_group::TaskId;pub use task_group::TaskKind;pub use task_group::TaskName;pub use task_group::TaskResult;pub use crate::blocking::BlockingDrainLease;pub use crate::blocking::BlockingExecutor;pub use crate::blocking::BlockingExecutorShutdownReport;pub use crate::resource_budget::ResourceBudget;pub use crate::service_context::ChildServiceContext;pub use crate::service_context::RootServiceContext;pub use crate::shutdown_deadline::ShutdownDeadline;pub use crate::shutdown_report::ShutdownReport;pub use crate::task_group::TaskGroup;
Modules§
- blocking
- Root-owned blocking admission with lane isolation and one global hard limit.
- common
- Common types and operations.
- prelude
- Minimal imports for owned service lifecycles, and the recommended entry path.
- resource_
budget - Resource budget types and operations.
- service_
context - Service context types and operations.
- shutdown_
deadline - Shutdown deadline types and operations.
- shutdown_
report - Shutdown report types and operations.
- signal
- Signal types and operations.
- task
- Task types and operations.
- task_
group - Task group types and operations.
Structs§
- Critical
Failure - A durable record of one critical task failure.
- Critical
Failure State - The owner-scoped authority for critical task failures.
- Critical
Failure Subscription - A bounded subscription to critical failure notifications.
- External
Operation - A static, low-cardinality label for an operation owned outside this crate.
- Local
Metadata File System - The production local filesystem implementation.
- Metadata
Deadline - An immutable absolute deadline for metadata admission and durability waits.
- Metadata
Generation - A monotonically increasing generation for one metadata resource.
- Metadata
IoActor - A cloneable handle to the bounded metadata I/O owner.
- Metadata
IoActor Limits Profile - The admission limits the metadata actor owns.
- Metadata
IoBlocking Lane Profile - The shared blocking lane limits in force for the metadata actor.
- Metadata
IoConfig - Metadata actor admission limits and legacy blocking-lane fields.
- Metadata
IoEffective Profile - A read-only view of the metadata I/O limits actually in force.
- Metadata
IoLegacy Blocking Field - One retained actor field together with the value that applies instead.
- Metadata
IoObserver - Read-only access that does not retain metadata admission or target ownership.
- Metadata
IoPlan - Metadata actor settings that passed deterministic admission validation.
- Metadata
IoReceipt - A receipt for an accepted immutable snapshot.
- Metadata
IoResource Snapshot - A snapshot of one logical metadata resource.
- Metadata
IoShutdown Report - Result of stopping admission and draining accepted work.
- Metadata
IoSnapshot - A point-in-time actor snapshot.
- Metadata
Target Identity - Process-local identity of one retained target history.
- Metadata
Target Registry Stats - Aggregate registry occupancy without resource names or target paths.
- Metadata
Write Request - An immutable write request accepted by
MetadataIoActor. - Operation
Context - Cancellation, deadline, and task-class metadata for one bounded operation.
- Operation
Wait Policy - Absolute deadlines for graceful completion and subsequent abort confirmation.
- Runtime
Blocking Kind Summary V1 - Aggregated task counts and elapsed-time information for one blocking-work kind.
- Runtime
Blocking Lane Summary V1 - Aggregated state for one blocking-executor lane.
- Runtime
Blocking Section V2 - Bounded blocking-executor state, including work that outlived its wait.
- Runtime
Config - Thread, driver and shutdown policy for one owned Tokio runtime.
- Runtime
Diagnostics - Represents runtime diagnostics.
- Runtime
Diagnostics Inputs - Component-owned inputs for the V2 view.
- Runtime
Diagnostics Snapshot - Represents runtime diagnostics snapshot.
- Runtime
Diagnostics View Options - Bounds applied while creating
RuntimeDiagnosticsViewV1. - Runtime
Diagnostics View Options V2 - Bounds applied while creating
RuntimeDiagnosticsViewV2. - Runtime
Diagnostics View V1 - Versioned, bounded, and sanitized runtime diagnostics safe for authenticated operational APIs.
- Runtime
Diagnostics View V2 - Versioned, bounded, and sanitized runtime diagnostics with explicit scopes.
- Runtime
Error - Stable, catalog-backed operational runtime failure.
- Runtime
Metadata Section V2 - Bounded retained-metadata state.
- Runtime
Owner - Owns one Tokio runtime and its root service context.
- Runtime
Owner Plan - A runtime configuration that has passed deterministic validation.
- Runtime
Resources - Process-wide resource capabilities owned by
crate::RuntimeOwner. - Runtime
Schedule Section V2 - Bounded scheduled-work aggregates.
- Runtime
Shutdown Section V2 - The most recent shutdown result for one group population.
- Runtime
Task Detail V2 - One bounded task detail.
- Runtime
Task Details - A bounded detail sample that does not scan aggregate subtree statistics.
- Runtime
Task Kind Summary V1 - Aggregated task counts and elapsed-time information for one task kind.
- Runtime
Task Section V2 - Bounded task counts for one group population.
- Scheduled
Execution Policy - Bounded execution policy for one scheduled task.
- Scheduled
Task Config - Name, cadence and run limit of one schedule.
- Scheduled
Task Group - Represents scheduled task group.
- Scheduled
Task Observer - Reads an explicitly selected set of schedules without retaining their owner.
- Scheduled
Task Snapshot - Represents scheduled task snapshot.
- Service
Lifecycle - Shared process lifecycle and health-probe owner.
- Service
Lifecycle Config - Versioned runtime configuration for the process lifecycle boundary.
- Service
Lifecycle Transition - One committed process state change.
from = Noneis the initial Starting event. - Shutdown
Request - Immutable first shutdown request and its shared absolute deadline.
- Task
Spawner - Narrow capability for spawning work owned by an existing
TaskGroup.
Enums§
- Critical
Failure Kind - How a critical task stopped being healthy.
- Critical
Failure Recovery - How a handled critical task failure affects the service.
- Dependency
Readiness - Aggregate dependency readiness, independent of maintenance and process shutdown.
- Drain
Request Methods - HTTP methods that the
/drainzprobe route accepts. - Metadata
Durability - The caller-visible completion boundary for a persistence request.
- Metadata
IoAdmission Outcome - The normal admission result for one metadata write request.
- Metadata
IoCommit Admission Outcome - Result of waiting for a committed metadata snapshot.
- Metadata
IoCommit Observation - What a caller actually confirmed about one admitted metadata snapshot.
- Metadata
IoCommit Outcome - The real persistence conclusion for an accepted metadata snapshot.
- Metadata
IoDurability Outcome - The normal durable-completion result for one metadata write request.
- Metadata
IoOperation - A filesystem step in the atomic replacement protocol.
- Metadata
Limit Source - Identifies the owner of one effective metadata limit.
- Metadata
Target Retirement Outcome - Result of explicitly ending a quiescent target’s history.
- Missed
Tick Policy - Policy for ticks that arrive while all run slots are occupied.
- Operation
Outcome - Why an accepted operation task finished, after its future was destroyed.
- Operation
Wait Outcome - Whether an operation’s task destruction was confirmed when waiting stopped.
- Runtime
Blocking Kind V1 - Identifies a bounded category of blocking work.
- Runtime
Blocking Lane V1 - Identifies a bounded blocking-executor lane.
- Runtime
Component - A stable component identifier used by the sanitized diagnostics view.
- Runtime
Contract Policy - A closed identifier for a deterministic runtime contract rule.
- Runtime
Contract Violation - A deterministic caller configuration or invariant violation.
- Runtime
Diagnostics Scope - Names the population a V2 diagnostics value covers.
- Runtime
Error Kind - Why a runtime operation failed, for callers that branch on the reason.
- Runtime
Lifecycle State V1 - Describes the lifecycle state of the root task group.
- Runtime
Operation - A closed, low-cardinality runtime operation identifier.
- Runtime
Task Kind V1 - Identifies a bounded category of runtime-owned task.
- Schedule
Mode - Identifies the schedule mode state.
- Scheduled
Task Concurrency - Maximum concurrent runs admitted for one bounded schedule.
- Scheduled
Task Control - Identifies the scheduled task control state.
- Scheduled
Task Registration Outcome - Describes the result of registering a scheduled task.
- Service
Lifecycle State - Stable process lifecycle states used by readiness and liveness probes.
- Shutdown
Reason - Source of the first shutdown request.
Traits§
- Metadata
File System - Filesystem abstraction used by the metadata actor.
- Operation
Outcome Observer - Observes task outcomes after future destruction.
- Service
Lifecycle Observer - Observes committed state changes without owning the lifecycle.
Functions§
- current_
thread_ committed_ stack_ bytes - Returns how many bytes of the calling thread’s stack are committed.
Type Aliases§
- Runtime
Result - Alias for an operational runtime result.