Skip to content

lukehedger/dfdx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dfdx

durable functions dx

Prerequisites

Develop

To start a local Bun server, run bun index.ts (or bun start)

Or, to enable hot reloading run bun --hot index.ts (or bun watch)

Restate

To start a local Restate server, run bun restate

The Restate UI is available at http://localhost:9070

NOTE: To register the service with Restate, run bun register

Test

To test the function locally, run curl localhost:8080/df/<key>/run --json '{"name": "Luke"}'

key should be a unique ID, like 123 or 456

The execution will be paused until the durable promise is resolved. To resolve the durable promise, run curl localhost:8080/df/14/signal --json '{"id": "<id>"}'

id can be any string, like "1" or "2"

To check the status of a workflow run, run curl localhost:8080/df/<key>/status

Deploy

Run bunx cdk deploy to deploy the CDK stack to your AWS account.

NOTE: This requires a deployed Restate server (see https://github.com/restatedev/cdk).

Watch mode

To enable hot reloading for the deployed function and infrastructure, run bunx cdk watch --hotswap

This will also print live logs from the function to stdout.

NOTE: You can view live logs from the function (without running CDK watch mode) by running aws logs tail /aws/lambda/df --follow

Test

To test the deployed function, run curl <API_GATEWAY_URL>/df/<key>/run --json '{"name": "Luke"}'

About

durable functions dx

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors