Skip to main content

Crate rocketmq_runtime

Crate rocketmq_runtime 

Source
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§

CriticalFailure
A durable record of one critical task failure.
CriticalFailureState
The owner-scoped authority for critical task failures.
CriticalFailureSubscription
A bounded subscription to critical failure notifications.
ExternalOperation
A static, low-cardinality label for an operation owned outside this crate.
LocalMetadataFileSystem
The production local filesystem implementation.
MetadataDeadline
An immutable absolute deadline for metadata admission and durability waits.
MetadataGeneration
A monotonically increasing generation for one metadata resource.
MetadataIoActor
A cloneable handle to the bounded metadata I/O owner.
MetadataIoActorLimitsProfile
The admission limits the metadata actor owns.
MetadataIoBlockingLaneProfile
The shared blocking lane limits in force for the metadata actor.
MetadataIoConfig
Metadata actor admission limits and legacy blocking-lane fields.
MetadataIoEffectiveProfile
A read-only view of the metadata I/O limits actually in force.
MetadataIoLegacyBlockingField
One retained actor field together with the value that applies instead.
MetadataIoObserver
Read-only access that does not retain metadata admission or target ownership.
MetadataIoPlan
Metadata actor settings that passed deterministic admission validation.
MetadataIoReceipt
A receipt for an accepted immutable snapshot.
MetadataIoResourceSnapshot
A snapshot of one logical metadata resource.
MetadataIoShutdownReport
Result of stopping admission and draining accepted work.
MetadataIoSnapshot
A point-in-time actor snapshot.
MetadataTargetIdentity
Process-local identity of one retained target history.
MetadataTargetRegistryStats
Aggregate registry occupancy without resource names or target paths.
MetadataWriteRequest
An immutable write request accepted by MetadataIoActor.
OperationContext
Cancellation, deadline, and task-class metadata for one bounded operation.
OperationWaitPolicy
Absolute deadlines for graceful completion and subsequent abort confirmation.
RuntimeBlockingKindSummaryV1
Aggregated task counts and elapsed-time information for one blocking-work kind.
RuntimeBlockingLaneSummaryV1
Aggregated state for one blocking-executor lane.
RuntimeBlockingSectionV2
Bounded blocking-executor state, including work that outlived its wait.
RuntimeConfig
Thread, driver and shutdown policy for one owned Tokio runtime.
RuntimeDiagnostics
Represents runtime diagnostics.
RuntimeDiagnosticsInputs
Component-owned inputs for the V2 view.
RuntimeDiagnosticsSnapshot
Represents runtime diagnostics snapshot.
RuntimeDiagnosticsViewOptions
Bounds applied while creating RuntimeDiagnosticsViewV1.
RuntimeDiagnosticsViewOptionsV2
Bounds applied while creating RuntimeDiagnosticsViewV2.
RuntimeDiagnosticsViewV1
Versioned, bounded, and sanitized runtime diagnostics safe for authenticated operational APIs.
RuntimeDiagnosticsViewV2
Versioned, bounded, and sanitized runtime diagnostics with explicit scopes.
RuntimeError
Stable, catalog-backed operational runtime failure.
RuntimeMetadataSectionV2
Bounded retained-metadata state.
RuntimeOwner
Owns one Tokio runtime and its root service context.
RuntimeOwnerPlan
A runtime configuration that has passed deterministic validation.
RuntimeResources
Process-wide resource capabilities owned by crate::RuntimeOwner.
RuntimeScheduleSectionV2
Bounded scheduled-work aggregates.
RuntimeShutdownSectionV2
The most recent shutdown result for one group population.
RuntimeTaskDetailV2
One bounded task detail.
RuntimeTaskDetails
A bounded detail sample that does not scan aggregate subtree statistics.
RuntimeTaskKindSummaryV1
Aggregated task counts and elapsed-time information for one task kind.
RuntimeTaskSectionV2
Bounded task counts for one group population.
ScheduledExecutionPolicy
Bounded execution policy for one scheduled task.
ScheduledTaskConfig
Name, cadence and run limit of one schedule.
ScheduledTaskGroup
Represents scheduled task group.
ScheduledTaskObserver
Reads an explicitly selected set of schedules without retaining their owner.
ScheduledTaskSnapshot
Represents scheduled task snapshot.
ServiceLifecycle
Shared process lifecycle and health-probe owner.
ServiceLifecycleConfig
Versioned runtime configuration for the process lifecycle boundary.
ServiceLifecycleTransition
One committed process state change. from = None is the initial Starting event.
ShutdownRequest
Immutable first shutdown request and its shared absolute deadline.
TaskSpawner
Narrow capability for spawning work owned by an existing TaskGroup.

Enums§

CriticalFailureKind
How a critical task stopped being healthy.
CriticalFailureRecovery
How a handled critical task failure affects the service.
DependencyReadiness
Aggregate dependency readiness, independent of maintenance and process shutdown.
DrainRequestMethods
HTTP methods that the /drainz probe route accepts.
MetadataDurability
The caller-visible completion boundary for a persistence request.
MetadataIoAdmissionOutcome
The normal admission result for one metadata write request.
MetadataIoCommitAdmissionOutcome
Result of waiting for a committed metadata snapshot.
MetadataIoCommitObservation
What a caller actually confirmed about one admitted metadata snapshot.
MetadataIoCommitOutcome
The real persistence conclusion for an accepted metadata snapshot.
MetadataIoDurabilityOutcome
The normal durable-completion result for one metadata write request.
MetadataIoOperation
A filesystem step in the atomic replacement protocol.
MetadataLimitSource
Identifies the owner of one effective metadata limit.
MetadataTargetRetirementOutcome
Result of explicitly ending a quiescent target’s history.
MissedTickPolicy
Policy for ticks that arrive while all run slots are occupied.
OperationOutcome
Why an accepted operation task finished, after its future was destroyed.
OperationWaitOutcome
Whether an operation’s task destruction was confirmed when waiting stopped.
RuntimeBlockingKindV1
Identifies a bounded category of blocking work.
RuntimeBlockingLaneV1
Identifies a bounded blocking-executor lane.
RuntimeComponent
A stable component identifier used by the sanitized diagnostics view.
RuntimeContractPolicy
A closed identifier for a deterministic runtime contract rule.
RuntimeContractViolation
A deterministic caller configuration or invariant violation.
RuntimeDiagnosticsScope
Names the population a V2 diagnostics value covers.
RuntimeErrorKind
Why a runtime operation failed, for callers that branch on the reason.
RuntimeLifecycleStateV1
Describes the lifecycle state of the root task group.
RuntimeOperation
A closed, low-cardinality runtime operation identifier.
RuntimeTaskKindV1
Identifies a bounded category of runtime-owned task.
ScheduleMode
Identifies the schedule mode state.
ScheduledTaskConcurrency
Maximum concurrent runs admitted for one bounded schedule.
ScheduledTaskControl
Identifies the scheduled task control state.
ScheduledTaskRegistrationOutcome
Describes the result of registering a scheduled task.
ServiceLifecycleState
Stable process lifecycle states used by readiness and liveness probes.
ShutdownReason
Source of the first shutdown request.

Traits§

MetadataFileSystem
Filesystem abstraction used by the metadata actor.
OperationOutcomeObserver
Observes task outcomes after future destruction.
ServiceLifecycleObserver
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§

RuntimeResult
Alias for an operational runtime result.