The Resonate Server implements the Durable Promise API.
Functions & Promises have emerged as a popular model of computation, elegantly expressing concurrency and coordination. Functions represent processes and Promises represent future values. Functions & Promises compose, allowing us to build even the largest system uniformly from the smallest building blocks.
A Durable Promise is an addressable, persistent promise. A Durable Promise as defined by the Durable Promise API is a representation of a future value.
-
Build
The resonate server supports
http
andgrpc
protocols as well assqlite
andpostgres
as a data store.# build go build -o resonate # start ./resonate serve time=2023-01-01T00:00:00.000-00:00 level=INFO msg="starting http server" addr=0.0.0.0:8001 time=2023-01-01T00:00:00.000-00:00 level=INFO msg="starting grpc server" addr=0.0.0.0:50051 time=2023-01-01T00:00:00.000-00:00 level=INFO msg="starting metrics server" addr=:9090
-
Create a Promise
Create a Durable Promise using a unique identifier and an idempotency key.
curl -X POST -H "Idempotency-Key: foo_create" -d '{ "param": { "data": "'"$(echo -n 'Durable Promise Created' | base64)"'" }, "timeout": 2524608000000 }' http://localhost:8001/promises/foo/create
-
Complete a Promise
Resolve or reject a Durable Promise using its identifier and an idempotency key.
curl -X POST -H "Idempotency-Key: foo_complete" -d '{ "value": { "data": "'"$(echo -n 'Durable Promise Resolved' | base64)"'" } }' http://localhost:8001/promises/foo/resolve
curl -X POST -H "Idempotency-Key: foo_complete" -d '{ "value": { "data": "'"$(echo -n 'Durable Promise Rejected' | base64)"'" } }' http://localhost:8001/promises/foo/reject
go run ./...
go test -v ./...
Contribute to the Resonate Server by submitting issues and pull requests. Your contributions will help shape the future of Durable Promises.
The Resonate Server is available under the Apache 2.0 License.
Build reliable and scalable applications with a delightful developer experience.