8000 GitHub - crt-fork/eventual: Build scalable and durable micro-services with APIs, Messaging and Workflows
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Build scalable and durable micro-services with APIs, Messaging and Workflows

License

Notifications You must be signed in to change notification settings

crt-fork/eventual

 
 

Repository files navigation

Eventual is a TypeScript framework for building event-driven applications on AWS using Commands, Events, Subscribers, Workflows and Streams.

Your application exports APIs, Workflows, etc. that are then imported to synthesize an AWS CDK or SST v2 stack that is then deployed to AWS.

import { event, task, workflow, api, HttpResponse } from "@eventual/core";

api.post("/work", async (request) => {
  const items: string[] = await request.json();

  const { executionId } = await myWorkflow.startExecution({
    input: items,
  });

  return new HttpResponse(JSON.stringify({ executionId }), {
    status: 200,
  });
});

export const myWorkflow = workflow("myWorkflow", async (items: string[]) => {
  const results = await Promise.all(items.map(doWork));

  await workDone.emit({
    outputs: results,
  });

  return results;
});

export const doWork = task("work", async (work: string) => {
  console.log("Doing Work", work);

  return work.length;
});

export interface WorkDoneEvent {
  outputs: number[];
}

export const workDone = event<WorkDoneEvent>("WorkDone");

About

Build scalable and durable micro-services with APIs, Messaging and Workflows

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.5%
  • Other 0.5%
0