Skip to main content

enact_core/background/
mod.rs

1//! Background Module - Background execution and triggers
2//!
3//! This module provides the infrastructure for background callable execution:
4//!
5//! - **Triggers**: Event-based callable invocation
6//! - **Executor**: Background execution with different modes
7//! - **Target Binding**: Binds execution results to targets
8//!
9//! ## Background Execution Modes
10//!
11//! - `FireAndForget`: Don't wait for result, no streaming
12//! - `Silent`: Wait for result, but suppress streaming events
13//! - `Deferred`: Queue for later execution
14//!
15//! ## Triggers
16//!
17//! Triggers watch for specific events and spawn background executions:
18//! - Event: Fired by execution/step events
19//! - Schedule: Fired by cron/interval schedules
20//! - Webhook: Fired by external webhooks
21//! - Threshold: Fired when metrics cross thresholds
22//! - Lifecycle: Fired by thread/user lifecycle events
23//!
24//! @see packages/enact-schemas/src/execution.schemas.ts
25//! @see docs/TECHNICAL/32-SPAWN-MODE.md
26
27pub mod executor;
28pub mod target_binding;
29pub mod trigger;
30
31// Re-exports - Trigger
32pub use trigger::{
33    RetryConfig, TargetBindingConfig as TriggerTargetBindingConfig,
34    TargetBindingType as TriggerTargetBindingType, ThresholdOperator, Trigger, TriggerAction,
35    TriggerCondition, TriggerFiredEvent, TriggerId, TriggerStatus, TriggerType,
36};
37
38// Re-exports - Executor
39pub use executor::{
40    BackgroundExecution, BackgroundExecutionConfig, BackgroundExecutionMode,
41    BackgroundExecutionQueue, BackgroundExecutionStatus,
42};
43
44// Re-exports - Target Binding
45pub use target_binding::{
46    apply_transform, TargetBindingConfig, TargetBindingResult, TargetBindingTransform,
47    TargetBindingType,
48};