Schedule module provides utilities for creating and composing schedules for retrying operations, repeating effects, and implementing various timing strategies.
A Schedule is a function that takes an input and returns a decision whether to continue or halt, along with a delay duration. Schedules can be combined, transformed, and used to implement sophisticated retry and repetition logic.
Overview
Schedules are used with:Effect.retry- Retry failed operationsEffect.repeat- Repeat successful operationsEffect.schedule- Schedule operations at intervals
Basic Schedules
Fixed Interval
Recur at fixed intervals.Limited Recurrence
Recur a specific number of times.Exponential Backoff
Increase delay exponentially.Fibonacci Backoff
Increase delay following Fibonacci sequence.Duration-Based
Recur once after a specific duration.Combining Schedules
Both (Intersection)
Continue only while both schedules want to continue.Either (Union)
Continue while either schedule wants to continue.Sequential Composition
Run schedules in sequence.Schedule Transformations
Limiting Duration
Limiting Attempts
Adding Jitter
Add randomness to delays.Conditional Schedules
Modifying Delays
Adding Delays
Modifying Delays
Collecting Outputs
Collect All Outputs
Collect Inputs
Conditional Collection
Cron Schedules
Schedule based on cron expressions.Tapping and Effects
Tap Output
Perform side effects on outputs.Tap Input
Perform side effects on inputs.Production Patterns
Capped Exponential with Jitter
Retry with Conditional Logic
Phased Retry Strategy
Using Schedules
With Effect.retry
With Effect.repeat
Schedule Builder Helper
Working with Metadata
Advanced: Custom Schedules
Using unfold
Using fromStep
API Types
Related
- Duration - Working with time spans
- Clock - System time and delays
- Cron - Cron expression support
- Effect Retry - Retry patterns
- Effect Repeat - Repeat patterns
