Skip to main content

qubit_execution_services/
lib.rs

1/*******************************************************************************
2 *
3 *    Copyright (c) 2025 - 2026 Haixing Hu.
4 *
5 *    SPDX-License-Identifier: Apache-2.0
6 *
7 *    Licensed under the Apache License, Version 2.0.
8 *
9 ******************************************************************************/
10//! # Qubit Execution Services
11//!
12//! Aggregated execution services facade for blocking, CPU-bound, Tokio blocking,
13//! and async IO tasks.
14//!
15
16mod execution_services;
17mod execution_services_build_error;
18mod execution_services_builder;
19mod execution_services_shutdown_report;
20
21pub use execution_services::ExecutionServices;
22pub use execution_services_build_error::ExecutionServicesBuildError;
23pub use execution_services_builder::ExecutionServicesBuilder;
24pub use execution_services_shutdown_report::ExecutionServicesShutdownReport;
25pub use qubit_executor::TaskHandle;
26pub use qubit_executor::service::{
27    ExecutorService,
28    RejectedExecution,
29    ShutdownReport,
30};
31pub use qubit_rayon_executor::{
32    RayonExecutorService,
33    RayonExecutorServiceBuildError,
34    RayonExecutorServiceBuilder,
35    RayonTaskHandle,
36};
37pub use qubit_thread_pool::{
38    ThreadPool,
39    ThreadPoolBuildError,
40    ThreadPoolBuilder,
41};
42pub use qubit_tokio_executor::{
43    TokioExecutorService,
44    TokioIoExecutorService,
45    TokioTaskHandle,
46};
47
48/// Default managed service for synchronous tasks that may block an OS thread.
49pub type BlockingExecutorService = ThreadPool;
50
51/// Builder alias for configuring [`BlockingExecutorService`].
52pub type BlockingExecutorServiceBuilder = ThreadPoolBuilder;
53
54/// Tokio-backed blocking executor service routed through `spawn_blocking`.
55pub type TokioBlockingExecutorService = TokioExecutorService;