Skip to main content

rocketmq_runtime/
blocking.rs

1// Copyright 2023 The RocketMQ Rust Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Root-owned blocking admission with lane isolation and one global hard limit.
16//!
17//! [`BlockingExecutor`] preserves the existing submission interface. Runtime
18//! composition creates one global budget and clones only handles into child
19//! contexts; queue admission, lane ceilings, reservations, the running permit,
20//! absolute deadlines, and diagnostics remain private implementation details.
21//! Each derived executor observes its scope gate; [`BlockingDrainLease`] is the
22//! bounded authorization for already accepted work and owner finalization.
23
24mod admission;
25mod diagnostics;
26mod executor;
27mod policy;
28
29pub use diagnostics::BlockingExecutorSnapshot;
30pub use diagnostics::BlockingTaskSnapshot;
31pub use executor::BlockingDrainLease;
32pub use executor::BlockingExecutor;
33pub use executor::BlockingExecutorShutdownReport;
34pub use policy::BlockingKind;
35pub use policy::BlockingLane;
36pub use policy::BlockingLanePolicies;
37pub use policy::BlockingPoolPolicy;
38pub use policy::BlockingTaskId;
39pub use policy::BlockingTaskState;
40
41pub(crate) use admission::GlobalBlockingBudget;
42pub(crate) use diagnostics::BlockingExecutorAggregate;
43pub(crate) use diagnostics::BlockingTaskTable;
44pub(crate) use diagnostics::IsolatedBlockingTables;