API reference: Trigger base¶
- class schedium.triggers.base.BaseTrigger[source][source]¶
Bases:
objectBase trigger node.
Triggers are pure (no mutation). Deduplication is handled at job level via the returned TriggerEvent.token.
- next_window(after, *, max_iterations=100000)[source][source]¶
Return the next validity window whose start is >=
after.For most constraint-style triggers, the default implementation:
finds the next matching time using a forward scan at an inferred granularity, then
returns a single-bucket window at that granularity.
- Parameters:
- afterdatetime
Lower bound (inclusive) for the returned window start.
- max_iterationsint, default 100_000
Safety cap used by some triggers/combinators that scan forward.
- Returns:
- schedium.types.time_window.TimeWindow | None
Next validity window, or
Noneif no future window exists.
- Raises:
- ValueError
If
max_iterations <= 0.- schedium.exceptions.NextRunMaxIterationsReached
If a forward scan exceeds
max_iterations.
- Parameters:
after (datetime)
max_iterations (int)
- Return type:
TimeWindow | None
- class schedium.triggers.base.BaseCombinatorTrigger(triggers)[source][source]¶
Bases:
BaseTrigger- Parameters:
triggers (Sequence[BaseTrigger])