vv_agent/
execution_mode.rs1use crate::runtime::backends::{
2 DistributedBackend, InlineBackend, RuntimeExecutionBackend, ThreadBackend,
3};
4
5#[derive(Debug, Clone, Default)]
6#[allow(clippy::large_enum_variant)] pub enum ExecutionMode {
8 #[default]
9 Inline,
10 Threaded {
11 max_workers: usize,
12 },
13 Distributed(DistributedBackend),
14}
15
16impl From<ExecutionMode> for RuntimeExecutionBackend {
17 fn from(mode: ExecutionMode) -> Self {
18 match mode {
19 ExecutionMode::Inline => Self::Inline(InlineBackend),
20 ExecutionMode::Threaded { max_workers } => {
21 Self::Thread(ThreadBackend::new(max_workers))
22 }
23 ExecutionMode::Distributed(backend) => Self::Distributed(backend),
24 }
25 }
26}