pub struct BackgroundExecutor { /* private fields */ }Expand description
Manages background gorilla tasks that run autonomously on schedules.
Implementations§
Source§impl BackgroundExecutor
impl BackgroundExecutor
Sourcepub fn with_shutdown(
shutdown_tx: Sender<bool>,
shutdown_rx: Receiver<bool>,
) -> Self
pub fn with_shutdown( shutdown_tx: Sender<bool>, shutdown_rx: Receiver<bool>, ) -> Self
Create a new background executor with a custom shutdown channel.
Sourcepub fn parse_schedule(schedule: &str) -> Option<Duration>
pub fn parse_schedule(schedule: &str) -> Option<Duration>
Parse a schedule string like “every 30s”, “every 5m”, “every 1h”, “every 1d”
into a std::time::Duration.
Sourcepub fn start_gorilla(
&self,
id: GorillaId,
manifest: GorillaManifest,
default_model: ModelConfig,
memory: Arc<MemorySubstrate>,
driver: Arc<dyn LlmDriver>,
) -> PunchResult<()>
pub fn start_gorilla( &self, id: GorillaId, manifest: GorillaManifest, default_model: ModelConfig, memory: Arc<MemorySubstrate>, driver: Arc<dyn LlmDriver>, ) -> PunchResult<()>
Start a gorilla’s autonomous background task.
The task will loop on the gorilla’s schedule, acquiring the LLM semaphore before each run, and executing the fighter loop with an autonomous prompt derived from the gorilla’s manifest.
default_model is used as a fallback when the gorilla manifest does
not specify its own model configuration.
Sourcepub fn stop_gorilla(&self, id: &GorillaId) -> bool
pub fn stop_gorilla(&self, id: &GorillaId) -> bool
Stop a gorilla’s background task by aborting it.
Sourcepub fn is_running(&self, id: &GorillaId) -> bool
pub fn is_running(&self, id: &GorillaId) -> bool
Check whether a gorilla is currently running.
Sourcepub fn list_running(&self) -> Vec<GorillaId>
pub fn list_running(&self) -> Vec<GorillaId>
List all currently running gorilla IDs.
Sourcepub fn shutdown_all(&self)
pub fn shutdown_all(&self)
Shutdown all running gorilla tasks.
Sourcepub fn running_count(&self) -> usize
pub fn running_count(&self) -> usize
Returns the number of currently running gorilla tasks.