pub struct PollingTriggerConfig {
pub interval: Duration,
pub probe: Box<dyn PollingProbe>,
pub workflow_name: String,
pub dedup: bool,
}Expand description
Configuration for a PollingTrigger.
§Examples
use std::time::Duration;
use ironflow_runtime::trigger::polling::{
PollingTriggerConfig, PollingProbe, ProbeFuture, ProbeResult,
};
struct Stub;
impl PollingProbe for Stub {
fn name(&self) -> &str { "stub" }
fn poll(&self) -> ProbeFuture<'_> {
Box::pin(async { Ok(Some(ProbeResult::new(serde_json::json!(null)))) })
}
}
let config = PollingTriggerConfig {
interval: Duration::from_secs(60),
probe: Box::new(Stub),
workflow_name: "my-workflow".to_string(),
dedup: true,
};Fields§
§interval: DurationHow often to poll.
probe: Box<dyn PollingProbe>The probe to execute.
workflow_name: StringThe workflow to trigger when the probe detects new data.
dedup: boolWhen true, skip triggering if the probe result hash matches the
previous one.
Auto Trait Implementations§
impl !RefUnwindSafe for PollingTriggerConfig
impl !UnwindSafe for PollingTriggerConfig
impl Freeze for PollingTriggerConfig
impl Send for PollingTriggerConfig
impl Sync for PollingTriggerConfig
impl Unpin for PollingTriggerConfig
impl UnsafeUnpin for PollingTriggerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more