Distributed

Async Await

A durable execution framework.

A dead simple cloud programming model.

Open source. Open specification.

Echo

Install the

SDK

npm install @resonatehq/sdk

Install the

Server

brew install resonatehq/tap/resonate

Write

Code

  // durable-payment.ts
  import { Resonate, Context } from "@resonatehq/sdk";
  
  // 1) Initialize Resonate executor
  const resonate = new Resonate();
  
  // 2) Register purchase as a durable async function
  resonate.register("purchase", purchase);
  
  async function purchase(ctx: Context, user: User, song: Song): Promise<Status> {
    const charged = await ctx.run(charge, user, song);
    const granted = await ctx.run(access, user, song);
    return { charged, granted };
  }
  
  // 3) Setup logic for routing to durable async function
  app.post("/purchase", async (req: Request, res: Response) => {
    const user = { id: req.body?.user ?? 1 };
    const song = { id: req.body?.song ?? 1, price: 1.99 };
  
    // 4) uniquely identify the execution
    const id = `purchase-${user.id}-${song.id}`;
    try {
      // 5) Call the purchase function and wait for the result
      res.send(await resonate.run("purchase", id, user, song));
    } catch (err) {
      res.status(500).send("Could not purchase song");
    }
  });

Concurrent, distributed, and durable

Promises and Functions

Distributed Async Awaitextendsthe async await programming model

beyondthe boundaries of a single process.

Distributed computing becomes afirst-classcitizen.

Your App, Your Way

Enjoy an

incremental path

to adoption

Extending, instead of replacing, async await

offers you anincremental transitionfrom the world of concurrent programming

into the world of distributed programming.

Start with the

SDK

Get retries, rate limiting, timeouts, cancelation, metrics, and tracing.

No infrastructure required.

Add the

Server

Run functions for minutes, hours, days, weeks, months, or years

regardless of hardware or software failures.

Then

Deploy anywhere

Run on prem, on the edge, in the cloud, or go serverless.