Tag

#state-machine

4 posts

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

Write Last, Read First account creation in TypeScript with TigerBeetle

How the Write Last, Read First state machine collapses to a short generator when each step is a durable checkpoint.

Create an account in a System of Reference (SQLite) and a System of Record (TigerBeetle) without a distributed transaction. Each step is a Resonate durable checkpoint; replays after a crash skip completed steps and finish the write.

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

One-click buy with a durable cancellation window in TypeScript on Resonate

A one-click checkout where the cancellation window is a durable `ctx.run` over a Promise race, not a `PENDING / CONFIRMED / CANCELLED` state row.

Start a purchase, open a 5-second window in which the user can cancel, then confirm or cancel. The window is one `ctx.run` over a Promise that races a timer against an EventEmitter signal — checkpointed, so a crash mid-window resumes from where it left off.

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

Durable order-lifecycle state machine in TypeScript on Resonate

How a six-state order workflow collapses to straight-line generator code when each ctx.run call is a durable checkpoint.

An order moves through created, confirmed, shipped, delivered (or cancelled, refunded), and must resume cleanly mid-transition after a crash. With Resonate the generator's execution position IS the state — each transition is a ctx.run checkpoint, no K/V store required.