Skip to main content
在 Manus 中运行任何 Skill
一键导入

restate-rust

星标4
分支0
更新时间2026年6月29日 20:14

How to AUTHOR a Restate handler in Rust (`restate-sdk` 0.10) without breaking durability — the determinism and error-handling contract that makes `workflows-service` replay-safe. Distilled from Restate's own `building-restate-services` skill (https://github.com/restatedev/skills), retargeted from its TS/Python/Java/Go examples to this workspace's Rust SDK and grounded in `workflows-service/src` (the only `restate-sdk` consumer). THE ONE RULE, load-bearing: every non-deterministic act — clock (`Utc::now`), randomness, UUIDs, a DB write, object storage, any network/IO call — must happen INSIDE `ctx.run(...)`, which journals the outcome so a replay reuses the recorded value instead of re-executing. Bare non-determinism in handler body = a replay that diverges from the journal = corrupted durable state. Trigger when adding or editing a handler in `workflows-service`, reaching for `#[restate_sdk::object]` / `#[restate_sdk::workflow]` / `#[restate_sdk::service]`, calling `ctx.run` / `ctx.get` / `ctx.set` / `ctx.sle

安装

用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。

SKILL.md
readonly