reifydb_runtime/pool/
mod.rs1#[cfg(all(not(reifydb_single_threaded), not(reifydb_dst)))]
5pub(crate) mod actor_pool;
6
7#[cfg(all(not(reifydb_single_threaded), not(reifydb_dst)))]
8pub mod compute;
9
10#[cfg(all(not(reifydb_single_threaded), not(reifydb_dst)))]
11mod host;
12
13#[cfg(all(not(reifydb_single_threaded), not(reifydb_dst)))]
14pub(crate) mod task;
15
16#[cfg(any(reifydb_single_threaded, reifydb_dst))]
17mod wasm;
18
19#[cfg(all(not(reifydb_single_threaded), not(reifydb_dst)))]
20pub use host::Pools;
21#[cfg(any(reifydb_single_threaded, reifydb_dst))]
22pub use wasm::Pools;
23
24#[derive(Debug, Clone)]
25pub struct PoolConfig {
26 pub coordination_threads: usize,
27
28 pub flow_threads: usize,
29
30 pub maintenance_threads: usize,
31
32 pub task_threads: usize,
33
34 pub compute_threads: usize,
35
36 pub async_threads: usize,
37}
38
39impl Default for PoolConfig {
40 fn default() -> Self {
41 Self {
42 coordination_threads: 2,
43 flow_threads: 2,
44 maintenance_threads: 1,
45 task_threads: 2,
46 compute_threads: 2,
47 async_threads: 1,
48 }
49 }
50}
51
52impl PoolConfig {
53 pub fn sync_only() -> Self {
54 Self {
55 coordination_threads: 1,
56 flow_threads: 1,
57 maintenance_threads: 1,
58 task_threads: 1,
59 compute_threads: 1,
60 async_threads: 0,
61 }
62 }
63}