Skip to main content

reifydb_runtime/pool/
mod.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2025 ReifyDB
3
4#[cfg(all(not(reifydb_single_threaded), not(reifydb_target = "dst")))]
5mod native;
6
7#[cfg(any(reifydb_single_threaded, reifydb_target = "dst"))]
8mod wasm;
9
10#[cfg(all(not(reifydb_single_threaded), not(reifydb_target = "dst")))]
11pub use native::Pools;
12#[cfg(any(reifydb_single_threaded, reifydb_target = "dst"))]
13pub use wasm::Pools;
14
15/// Configuration for thread pool sizes.
16#[derive(Debug, Clone)]
17pub struct PoolConfig {
18	/// Threads for the system pool (lightweight actors).
19	pub system_threads: usize,
20	/// Threads for the query pool (execution-heavy actors).
21	pub query_threads: usize,
22	/// Threads for the async pool (tokio runtime).
23	pub async_threads: usize,
24}
25
26impl Default for PoolConfig {
27	fn default() -> Self {
28		Self {
29			system_threads: 1,
30			query_threads: 1,
31			async_threads: 0,
32		}
33	}
34}