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