Tag

#durable-sleep

13 posts

Resonate brand card on a dark background with a teal spectrum wave at the bottom and the post headline in white Sansation.
5 min readResonate HQJust published

Infinite AI chess workflow in TypeScript on GCP Cloud Functions

How an AI-vs-AI chess match becomes a generator on a serverless function — durable, bounded in replay, recursive across games via ctx.detached.

Two AI players take turns through a generator function on a Cloud Function. Each move is a durable checkpoint, each pause is a durable sleep, and a detached tail call re-roots the workflow after every game so replay scope stays bounded forever.

Resonate brand card on a dark background with an ember spectrum wave at the bottom and the post headline in white Sansation.
4 min readResonate HQJust published

Durable sleep across process crashes in Rust on Resonate

How `ctx.sleep` collapses long-lived waits into one line by suspending the workflow against a durable timer promise.

Suspend a workflow for seconds, days, or years without holding a process open. The sleep is a server-backed timer promise; another worker resumes the workflow when the timer fires, even if the original worker is gone.

Resonate brand card on a dark background with a teal spectrum wave at the bottom and the post headline in white Sansation.
4 min readResonate HQJust published

Durable entity as a long-running workflow in TypeScript on Resonate

How a user session lifecycle is expressed as a single generator function when each step is a Resonate durable checkpoint and the idle timer survives crashes.

Model a user session as a long-running generator: login, per-activity checkpoints, durable idle timeout, and cleanup. Crashes resume mid-lifecycle without re-recording earlier activities or restarting the timer.

Resonate brand card on a dark background with a teal spectrum wave at the bottom and the post headline in white Sansation.
4 min readResonate HQJust published

Long-running Hacker News research agent in TypeScript on Resonate

How an infinite monitoring loop, an LLM call per story, and an in-memory deduplication set survive process restarts without an external state store.

A continuous LLM-driven monitor that scans Hacker News, scores stories for relevance, and notifies on findings. Each step is a durable checkpoint and the deduplication set rebuilds itself from the promise store on restart.

Resonate brand card on a dark background with a teal spectrum wave at the bottom and the post headline in white Sansation.
4 min readResonate HQJust published

Infinite monitoring workflow in TypeScript on Resonate

How an unbounded health-check loop stays durable across step failures using ctx.run plus ctx.sleep, with no periodic history-reset step.

A health monitor that loops forever — check services, alert, sleep, repeat. The loop is a plain while; each iteration is a Resonate checkpoint, each pause is a durable sleep, and there is no history-size limit to reset by hand.

Resonate brand card on a dark background with a plum spectrum wave at the bottom and the post headline in white Sansation.
5 min readResonate HQJust published

Durable Hacker News research agent in Python on Resonate

How a long-running keyword-monitoring agent collapses to a generator workflow when every yield is a durable checkpoint and the promise store IS the state store.

Continuously scan Hacker News, score each story with an LLM, and notify on hits — without re-analyzing stories after a crash. Every step is a Resonate checkpoint and the dedup set rebuilds on replay, so no external database is needed.

Resonate brand card on a dark background with a teal spectrum wave at the bottom and the post headline in white Sansation.
7 min readResonate HQJust published

Durable countdowns across AWS, Cloudflare, GCP, Supabase, Kafka, browser, and Python

How one durable-sleep workflow runs on Lambda, Workers, Cloud Functions, Edge Functions, Kafka, browsers, and Python without changing the function body.

A countdown loop that sleeps between steps and survives crashes, shown across 8 deployment shapes. The workflow body is one generator; only the platform adapter changes.

Resonate brand card on a dark background with a plum spectrum wave at the bottom and the post headline in white Sansation.
3 min readResonate HQJust published

Async MCP tool backed by a durable background job in Python

How an MCP server returns a promise id instead of blocking, and lets the agent ask back later — backed by a Resonate-registered function and a durable sleep.

Expose a long-running job to an LLM as an MCP tool that returns a promise id immediately, then let the agent poll for completion against a durable promise on the Resonate server.

Resonate brand card on a dark background with a plum spectrum wave at the bottom and the post headline in white Sansation.
4 min readResonate HQJust published

Durable sleep across process crashes in Python on Resonate

How `ctx.sleep` collapses long-lived waits into one yield by suspending the workflow against a durable timer promise.

Suspend a workflow for seconds, days, or years without holding a Python process open. The sleep is a server-backed timer promise; another worker resumes the workflow when the timer fires, even if the original worker is gone.

Resonate brand card on a dark background with a plum spectrum wave at the bottom and the post headline in white Sansation.
6 min readResonate HQJust published

Schedule-and-act reminder agent in Python on Resonate

How an autonomous agent loop with a long-lived sleep step collapses to straight-line generator code when each yield is a durable checkpoint.

An LLM-driven reminder assistant that parses a natural-language request, picks a target timestamp, and sleeps until then before sending the reminder. The sleep is a durable timer, so no cron, queue, or database is needed.