DelayKit
A catalog of things you can do with DelayKit
Each pattern maps a concrete problem to the DelayKit API. If you’re not sure which one you need, start with Send a reminder or Debounce a flurry.
Send a reminder
Schedule a notification for later. The handler checks current state when it fires.
dk.schedule("remind", { delay: "24h" })Expire something
Run cleanup the moment a deadline passes. Invitations, trials, holds.
dk.schedule("expire-trial", { delay: "14d" })Debounce a flurry
Collapse fifty events into one action. Durable across restarts.
dk.debounce("reindex", { wait: "5s" })Retry with backoff
Something failed during a request. Defer the retry instead of blocking the response.
dk.schedule("retry-charge", { delay: "1m" })Coalesce into a digest
Collapse a burst of events into one handler run per window. The handler fires at the end of the window with the latest state.
dk.throttle("digest", { wait: "1m" })Schedule a follow-up
Run a task after a period of user inactivity. Each call resets the clock.
dk.debounce("follow-up", { key, wait: "3d" })Deferred cleanup
Fire-and-forget maintenance. Schedule it once, let it run.
dk.schedule("cleanup", { delay: "1h" })Renew before expiry
Refresh a token, lease, or session a few minutes before it expires.
dk.schedule("refresh", { delay: "55m" })Dead man's switch
Alarm when something stops happening. The absence of an event is the trigger.
dk.schedule("missed-heartbeat", { delay: "5m" })Poll until done
Wait on async work by checking back periodically until it's ready — or until you give up.
dk.schedule("check", { delay: "2m" })Schedule a drip sequence
Schedule every step of an onboarding or trial drip up front. Each handler checks current state when it fires.
dk.schedule("drip-day-3", { delay: "3d" })Delayed publish
Publish a post, send an email, or release content at a specific future time.
dk.schedule("publish", { at: post.publishAt })