scheduling_skill
- TypeScript
5
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill andrueandersoncs/claude-skill-effect-ts --skill scheduling- SKILL.md6.2 KB
Overview
This skill explains how to use Effect's scheduling primitives to retry, repeat, poll, and apply backoff strategies. It highlights built-in schedules, combinators, cron integration, and common patterns for resilient, observable operations. Use it to choose and compose schedules for retries, polling, and timed repetitions.
How this skill works
Schedules describe timing and stop conditions and can be attached to effects via Effect.retry, Effect.repeat, or Effect.schedule. Built-in schedules include fixed intervals, spaced delays, exponential and linear backoffs, recurrences, and cron-based triggers. Combinators let you compose, cap, jitter, delay, reset, and extract schedule outputs (count, elapsed, collected values).
When to use it
- Retrying failed operations with backoff (e.g., API calls)
- Polling a service or job status on an interval
- Repeating successful tasks (e.g., heartbeat or sync)
- Implementing circuit-breaker-like reset or failure counting
- Scheduling tasks with cron expressions for calendar-based triggers
Best practices
- Always include a recurs or upTo limit to avoid infinite retries
- Add jitter to distributed retries to prevent thundering-herd effects
- Cap exponential backoff using upTo to bound maximum delay
- Log or tapInput on retry attempts for observability
- Differentiate schedules by error type (transient vs permanent)
Example use cases
- API retry with exponential backoff, jitter, a max delay, and a max attempt count
- Polling a job status every few seconds with an overall timeout
- Repeating a success-based check every fixed interval using Effect.repeat
- Using Schedule.cron(parse) to run daily or hourly tasks
- Counting failures and resetting the schedule after a cooldown to implement circuit-breaker behavior
FAQ
Use Effect.retry with a while or until predicate that inspects the error and returns false/true to stop retries for fatal errors.
How can I avoid synchronized retries across many clients?
Apply Schedule.jittered (or custom jitter range) to add randomized variation to backoff intervals and prevent thundering-herd spikes.