cloacina-python::bindings::context
Rust
Re-exports
Section titled “Re-exports”Structs
Section titled “Structs”class DefaultRunnerConfig
Section titled “class DefaultRunnerConfig”Binding
Python API:
cloaca.DefaultRunnerConfig
PyDefaultRunnerConfig - Python wrapper for Rust DefaultRunnerConfig
Fields
Section titled “Fields”| Name | Type | Description |
|---|---|---|
inner |
cloacina::runner::DefaultRunnerConfig |
Methods
Section titled “Methods”fn new( max_concurrent_tasks: Option<usize>, scheduler_poll_interval_ms: Option<u64>, task_timeout_seconds: Option<u64>, workflow_timeout_seconds: Option<u64>, db_pool_size: Option<u32>, enable_recovery: Option<bool>, enable_cron_scheduling: Option<bool>, cron_poll_interval_seconds: Option<u64>, cron_max_catchup_executions: Option<usize>, cron_enable_recovery: Option<bool>, cron_recovery_interval_seconds: Option<u64>, cron_lost_threshold_minutes: Option<i32>, cron_max_recovery_age_seconds: Option<u64>, cron_max_recovery_attempts: Option<usize>,) -> pyo3::PyResult<Self>Python API:
cloaca.DefaultRunnerConfig.new
Creates a new DefaultRunnerConfig with customizable parameters
Source
pub fn new( max_concurrent_tasks: Option<usize>, scheduler_poll_interval_ms: Option<u64>, task_timeout_seconds: Option<u64>, workflow_timeout_seconds: Option<u64>, db_pool_size: Option<u32>, enable_recovery: Option<bool>, enable_cron_scheduling: Option<bool>, cron_poll_interval_seconds: Option<u64>, cron_max_catchup_executions: Option<usize>, cron_enable_recovery: Option<bool>, cron_recovery_interval_seconds: Option<u64>, cron_lost_threshold_minutes: Option<i32>, cron_max_recovery_age_seconds: Option<u64>, cron_max_recovery_attempts: Option<usize>, ) -> pyo3::PyResult<Self> { use std::time::Duration;
let mut builder = cloacina::runner::DefaultRunnerConfig::builder();
if let Some(val) = max_concurrent_tasks { builder = builder.max_concurrent_tasks(val); } if let Some(val) = scheduler_poll_interval_ms { builder = builder.scheduler_poll_interval(Duration::from_millis(val)); } if let Some(val) = task_timeout_seconds { builder = builder.task_timeout(Duration::from_secs(val)); } if let Some(val) = workflow_timeout_seconds { builder = builder.workflow_timeout(Some(Duration::from_secs(val))); } if let Some(val) = db_pool_size { builder = builder.db_pool_size(val); } if let Some(val) = enable_recovery { builder = builder.enable_recovery(val); } if let Some(val) = enable_cron_scheduling { builder = builder.enable_cron_scheduling(val); } if let Some(val) = cron_poll_interval_seconds { builder = builder.cron_poll_interval(Duration::from_secs(val)); } if let Some(val) = cron_max_catchup_executions { builder = builder.cron_max_catchup_executions(val); } if let Some(val) = cron_enable_recovery { builder = builder.cron_enable_recovery(val); } if let Some(val) = cron_recovery_interval_seconds { builder = builder.cron_recovery_interval(Duration::from_secs(val)); } if let Some(val) = cron_lost_threshold_minutes { builder = builder.cron_lost_threshold_minutes(val); } if let Some(val) = cron_max_recovery_age_seconds { builder = builder.cron_max_recovery_age(Duration::from_secs(val)); } if let Some(val) = cron_max_recovery_attempts { builder = builder.cron_max_recovery_attempts(val); }
Ok(PyDefaultRunnerConfig { inner: builder.build().map_err(|e| { pyo3::exceptions::PyValueError::new_err(format!("Invalid configuration: {}", e)) })?, }) }default
Section titled “default”fn default() -> SelfPython API:
cloaca.DefaultRunnerConfig.default
Creates a DefaultRunnerConfig with all default values
Source
pub fn default() -> Self { PyDefaultRunnerConfig { inner: cloacina::runner::DefaultRunnerConfig::default(), } }max_concurrent_tasks
Section titled “max_concurrent_tasks”fn max_concurrent_tasks(&self) -> usizePython API:
cloaca.DefaultRunnerConfig.max_concurrent_tasks
Source
pub fn max_concurrent_tasks(&self) -> usize { self.inner.max_concurrent_tasks() }scheduler_poll_interval_ms
Section titled “scheduler_poll_interval_ms”fn scheduler_poll_interval_ms(&self) -> u64Python API:
cloaca.DefaultRunnerConfig.scheduler_poll_interval_ms
Source
pub fn scheduler_poll_interval_ms(&self) -> u64 { self.inner.scheduler_poll_interval().as_millis() as u64 }task_timeout_seconds
Section titled “task_timeout_seconds”fn task_timeout_seconds(&self) -> u64Python API:
cloaca.DefaultRunnerConfig.task_timeout_seconds
Source
pub fn task_timeout_seconds(&self) -> u64 { self.inner.task_timeout().as_secs() }workflow_timeout_seconds
Section titled “workflow_timeout_seconds”fn workflow_timeout_seconds(&self) -> Option<u64>Python API:
cloaca.DefaultRunnerConfig.workflow_timeout_seconds
Source
pub fn workflow_timeout_seconds(&self) -> Option<u64> { self.inner.workflow_timeout().map(|d| d.as_secs()) }db_pool_size
Section titled “db_pool_size”fn db_pool_size(&self) -> u32Python API:
cloaca.DefaultRunnerConfig.db_pool_size
Source
pub fn db_pool_size(&self) -> u32 { self.inner.db_pool_size() }enable_recovery
Section titled “enable_recovery”fn enable_recovery(&self) -> boolPython API:
cloaca.DefaultRunnerConfig.enable_recovery
Source
pub fn enable_recovery(&self) -> bool { self.inner.enable_recovery() }enable_cron_scheduling
Section titled “enable_cron_scheduling”fn enable_cron_scheduling(&self) -> boolPython API:
cloaca.DefaultRunnerConfig.enable_cron_scheduling
Source
pub fn enable_cron_scheduling(&self) -> bool { self.inner.enable_cron_scheduling() }cron_poll_interval_seconds
Section titled “cron_poll_interval_seconds”fn cron_poll_interval_seconds(&self) -> u64Python API:
cloaca.DefaultRunnerConfig.cron_poll_interval_seconds
Source
pub fn cron_poll_interval_seconds(&self) -> u64 { self.inner.cron_poll_interval().as_secs() }cron_max_catchup_executions
Section titled “cron_max_catchup_executions”fn cron_max_catchup_executions(&self) -> usizePython API:
cloaca.DefaultRunnerConfig.cron_max_catchup_executions
Source
pub fn cron_max_catchup_executions(&self) -> usize { self.inner.cron_max_catchup_executions() }cron_enable_recovery
Section titled “cron_enable_recovery”fn cron_enable_recovery(&self) -> boolPython API:
cloaca.DefaultRunnerConfig.cron_enable_recovery
Source
pub fn cron_enable_recovery(&self) -> bool { self.inner.cron_enable_recovery() }cron_recovery_interval_seconds
Section titled “cron_recovery_interval_seconds”fn cron_recovery_interval_seconds(&self) -> u64Python API:
cloaca.DefaultRunnerConfig.cron_recovery_interval_seconds
Source
pub fn cron_recovery_interval_seconds(&self) -> u64 { self.inner.cron_recovery_interval().as_secs() }cron_lost_threshold_minutes
Section titled “cron_lost_threshold_minutes”fn cron_lost_threshold_minutes(&self) -> i32Python API:
cloaca.DefaultRunnerConfig.cron_lost_threshold_minutes
Source
pub fn cron_lost_threshold_minutes(&self) -> i32 { self.inner.cron_lost_threshold_minutes() }cron_max_recovery_age_seconds
Section titled “cron_max_recovery_age_seconds”fn cron_max_recovery_age_seconds(&self) -> u64Python API:
cloaca.DefaultRunnerConfig.cron_max_recovery_age_seconds
Source
pub fn cron_max_recovery_age_seconds(&self) -> u64 { self.inner.cron_max_recovery_age().as_secs() }cron_max_recovery_attempts
Section titled “cron_max_recovery_attempts”fn cron_max_recovery_attempts(&self) -> usizePython API:
cloaca.DefaultRunnerConfig.cron_max_recovery_attempts
Source
pub fn cron_max_recovery_attempts(&self) -> usize { self.inner.cron_max_recovery_attempts() }set_max_concurrent_tasks
Section titled “set_max_concurrent_tasks”fn set_max_concurrent_tasks(&mut self, value: usize)Python API:
cloaca.DefaultRunnerConfig.set_max_concurrent_tasks
Source
pub fn set_max_concurrent_tasks(&mut self, value: usize) { self.inner = self.rebuild(|b| b.max_concurrent_tasks(value)); }set_scheduler_poll_interval_ms
Section titled “set_scheduler_poll_interval_ms”fn set_scheduler_poll_interval_ms(&mut self, value: u64)Python API:
cloaca.DefaultRunnerConfig.set_scheduler_poll_interval_ms
Source
pub fn set_scheduler_poll_interval_ms(&mut self, value: u64) { self.inner = self.rebuild(|b| b.scheduler_poll_interval(std::time::Duration::from_millis(value))); }set_task_timeout_seconds
Section titled “set_task_timeout_seconds”fn set_task_timeout_seconds(&mut self, value: u64)Python API:
cloaca.DefaultRunnerConfig.set_task_timeout_seconds
Source
pub fn set_task_timeout_seconds(&mut self, value: u64) { self.inner = self.rebuild(|b| b.task_timeout(std::time::Duration::from_secs(value))); }set_workflow_timeout_seconds
Section titled “set_workflow_timeout_seconds”fn set_workflow_timeout_seconds(&mut self, value: Option<u64>)Python API:
cloaca.DefaultRunnerConfig.set_workflow_timeout_seconds
Source
pub fn set_workflow_timeout_seconds(&mut self, value: Option<u64>) { self.inner = self.rebuild(|b| b.workflow_timeout(value.map(std::time::Duration::from_secs))); }set_db_pool_size
Section titled “set_db_pool_size”fn set_db_pool_size(&mut self, value: u32)Python API:
cloaca.DefaultRunnerConfig.set_db_pool_size
Source
pub fn set_db_pool_size(&mut self, value: u32) { self.inner = self.rebuild(|b| b.db_pool_size(value)); }set_enable_recovery
Section titled “set_enable_recovery”fn set_enable_recovery(&mut self, value: bool)Python API:
cloaca.DefaultRunnerConfig.set_enable_recovery
Source
pub fn set_enable_recovery(&mut self, value: bool) { self.inner = self.rebuild(|b| b.enable_recovery(value)); }set_enable_cron_scheduling
Section titled “set_enable_cron_scheduling”fn set_enable_cron_scheduling(&mut self, value: bool)Python API:
cloaca.DefaultRunnerConfig.set_enable_cron_scheduling
Source
pub fn set_enable_cron_scheduling(&mut self, value: bool) { self.inner = self.rebuild(|b| b.enable_cron_scheduling(value)); }set_cron_poll_interval_seconds
Section titled “set_cron_poll_interval_seconds”fn set_cron_poll_interval_seconds(&mut self, value: u64)Python API:
cloaca.DefaultRunnerConfig.set_cron_poll_interval_seconds
Source
pub fn set_cron_poll_interval_seconds(&mut self, value: u64) { self.inner = self.rebuild(|b| b.cron_poll_interval(std::time::Duration::from_secs(value))); }set_cron_max_catchup_executions
Section titled “set_cron_max_catchup_executions”fn set_cron_max_catchup_executions(&mut self, value: usize)Python API:
cloaca.DefaultRunnerConfig.set_cron_max_catchup_executions
Source
pub fn set_cron_max_catchup_executions(&mut self, value: usize) { self.inner = self.rebuild(|b| b.cron_max_catchup_executions(value)); }set_cron_enable_recovery
Section titled “set_cron_enable_recovery”fn set_cron_enable_recovery(&mut self, value: bool)Python API:
cloaca.DefaultRunnerConfig.set_cron_enable_recovery
Source
pub fn set_cron_enable_recovery(&mut self, value: bool) { self.inner = self.rebuild(|b| b.cron_enable_recovery(value)); }set_cron_recovery_interval_seconds
Section titled “set_cron_recovery_interval_seconds”fn set_cron_recovery_interval_seconds(&mut self, value: u64)Python API:
cloaca.DefaultRunnerConfig.set_cron_recovery_interval_seconds
Source
pub fn set_cron_recovery_interval_seconds(&mut self, value: u64) { self.inner = self.rebuild(|b| b.cron_recovery_interval(std::time::Duration::from_secs(value))); }set_cron_lost_threshold_minutes
Section titled “set_cron_lost_threshold_minutes”fn set_cron_lost_threshold_minutes(&mut self, value: i32)Python API:
cloaca.DefaultRunnerConfig.set_cron_lost_threshold_minutes
Source
pub fn set_cron_lost_threshold_minutes(&mut self, value: i32) { self.inner = self.rebuild(|b| b.cron_lost_threshold_minutes(value)); }set_cron_max_recovery_age_seconds
Section titled “set_cron_max_recovery_age_seconds”fn set_cron_max_recovery_age_seconds(&mut self, value: u64)Python API:
cloaca.DefaultRunnerConfig.set_cron_max_recovery_age_seconds
Source
pub fn set_cron_max_recovery_age_seconds(&mut self, value: u64) { self.inner = self.rebuild(|b| b.cron_max_recovery_age(std::time::Duration::from_secs(value))); }set_cron_max_recovery_attempts
Section titled “set_cron_max_recovery_attempts”fn set_cron_max_recovery_attempts(&mut self, value: usize)Python API:
cloaca.DefaultRunnerConfig.set_cron_max_recovery_attempts
Source
pub fn set_cron_max_recovery_attempts(&mut self, value: usize) { self.inner = self.rebuild(|b| b.cron_max_recovery_attempts(value)); }to_dict
Section titled “to_dict”fn to_dict(&self, py: Python<'_>) -> PyResult<Py<PyAny>>Python API:
cloaca.DefaultRunnerConfig.to_dict
Returns a dictionary representation of the configuration
Source
pub fn to_dict(&self, py: Python<'_>) -> PyResult<Py<PyAny>> { let dict = pyo3::types::PyDict::new(py);
dict.set_item("max_concurrent_tasks", self.inner.max_concurrent_tasks())?; dict.set_item( "scheduler_poll_interval_ms", self.inner.scheduler_poll_interval().as_millis() as u64, )?; dict.set_item("task_timeout_seconds", self.inner.task_timeout().as_secs())?; dict.set_item( "workflow_timeout_seconds", self.inner.workflow_timeout().map(|d| d.as_secs()), )?; dict.set_item("db_pool_size", self.inner.db_pool_size())?; dict.set_item("enable_recovery", self.inner.enable_recovery())?; dict.set_item( "enable_cron_scheduling", self.inner.enable_cron_scheduling(), )?; dict.set_item( "cron_poll_interval_seconds", self.inner.cron_poll_interval().as_secs(), )?; dict.set_item( "cron_max_catchup_executions", self.inner.cron_max_catchup_executions(), )?; dict.set_item("cron_enable_recovery", self.inner.cron_enable_recovery())?; dict.set_item( "cron_recovery_interval_seconds", self.inner.cron_recovery_interval().as_secs(), )?; dict.set_item( "cron_lost_threshold_minutes", self.inner.cron_lost_threshold_minutes(), )?; dict.set_item( "cron_max_recovery_age_seconds", self.inner.cron_max_recovery_age().as_secs(), )?; dict.set_item( "cron_max_recovery_attempts", self.inner.cron_max_recovery_attempts(), )?;
Ok(dict.into()) }__repr__
Section titled “__repr__”fn __repr__(&self) -> StringPython API:
cloaca.DefaultRunnerConfig.__repr__
String representation of the configuration
Source
pub fn __repr__(&self) -> String { format!( "DefaultRunnerConfig(max_concurrent_tasks={}, enable_cron_scheduling={}, db_pool_size={})", self.inner.max_concurrent_tasks(), self.inner.enable_cron_scheduling(), self.inner.db_pool_size() ) }