What problem does it solve?
Provides clear, practical patterns for writing and organizing Ephemeral World code that initializes the Resonate client, registers functions, starts and monitors executions, manages cross-process RPCs, and shares non-serializable dependencies, removing common confusion between ephemeral (client) and durable (context) APIs.
Core Features & Use Cases
- Client Initialization Modes: Guidance for local in-memory development and server-connected configurations using environment variables and constructor options.
- Function Registration & Invocation: Best practices for registering functions by reference, invoking with run/beginRun for local execution, and rpc/beginRpc for remote execution with explicit targets.
- Promise Management & Human-in-the-Loop: Create, get, resolve, and reject promises for external approvals and asynchronous coordination.
- Dependency Injection & Scheduling: Set non-serializable dependencies in the ephemeral world for use by durable functions and create cron-like schedules for recurring tasks.
- Common Pitfalls & Decision Rules: Clear rules to avoid mixing Client and Context APIs, handle in-memory argument wrapping, and use correct RPC targets.
Quick Start
Initialize a Resonate client, set required dependencies, register your workflow functions, and start a run or RPC with a unique execution id to observe the ephemeral-to-durable flow.