durable-execution-sdk-macros
Procedural macros for the AWS Durable Execution SDK.
Overview
This crate provides the #[durable_execution] attribute macro that transforms an async function into a Lambda handler compatible with the AWS Durable Execution service. You typically don't need to depend on this crate directly — it's re-exported by durable-execution-sdk when the macros feature is enabled (on by default).
Usage
use ;
use ;
async
What the macro does
The #[durable_execution] attribute generates two functions from your handler:
- An inner async function (
__<name>_inner) containing your original logic - A Lambda handler wrapper that accepts
LambdaEvent<DurableExecutionInvocationInput>and delegates torun_durable_handlerwith the inner function
All runtime concerns (event deserialization, state management, context creation, result/error/suspend handling) are encapsulated in run_durable_handler.
Function signature requirements
The decorated function must:
- Be
async - Have exactly two parameters:
(event: EventType, ctx: DurableContext) - Return
Result<T, DurableError>whereT: Serialize EventTypemust implementDeserialize
License
Apache-2.0