Tag

#durable-sleep

15 posts

Resonate brand card on a dark background with an ember spectrum wave at the lower left, the headline 'Durable Sleep' in white Sansation, and the subtitle 'Coming from Temporal · Go SDK'.
5 min readResonate HQ

Coming from Temporal: Durable Sleep in Go

Temporal's sleep-for-days races a 30-day timer against a signal channel via NewSelector. Resonate's equivalent is ctx.Sleep(d) + f.Await(nil) — Selector gone, durability kept.

Port Temporal's sleep-for-days sample to Resonate. The timer leg of the Selector loop maps to ctx.Sleep(d) + f.Await(nil); crash recovery resumes on the remaining time, not from zero.

Resonate brand card on a dark background with an ember spectrum wave at the lower left, the headline 'Countdown' in white Sansation, and the subtitle 'Coming from Temporal · Go SDK'.
5 min readResonate HQ

Coming from Temporal: Durable Countdown Loop in Go

The durable-loop-of-ticks pattern — ctx.RPC then ctx.Sleep each iteration — replaces workflow.ExecuteActivity + workflow.NewTimer + NewSelector with two two-liners per tick.

A durable loop of ctx.RPC + ctx.Sleep ticks that resumes at the next pending tick after a crash; maps structurally to Temporal's sleep-for-days, timer, and cron samples.

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 HQ

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 a teal spectrum wave at the bottom and the post headline in white Sansation.
4 min readResonate HQ

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 HQ

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 HQ

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 HQ

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 plum spectrum wave at the bottom and the post headline in white Sansation.
6 min readResonate HQ

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.