resonate-basic-durable-world-usage-python
Installation
SKILL.md
Resonate Basic Durable World Usage — Python
Overview
Durable functions are the payload of Resonate. They are async def coroutines that the SDK treats as a sequence of durable checkpoints. Every await ctx.run(...) or await ctx.rpc(...) is a save point: if the process crashes, the function resumes from the last successful checkpoint on another process or a restart.
This skill covers the Context API (ctx.*) that you use inside those functions. The ephemeral-world counterpart (Resonate class, registration, top-level invocation) lives in resonate-basic-ephemeral-world-usage-python.
The contract
Every durable function:
- Is registered with
r.register(fn)in the ephemeral world. - Takes
ctx(the Context) as its first parameter; any other parameters after that are the invocation args. - Uses
awaitto interact withctx. Each awaitedctx.*call is a durable checkpoint. - Is deterministic when replayed: no direct
time.time(), norandom.random(), no raw network I/O outsidectx.run.
Minimal shape: