Skip to main content

Function versioning

Function versioning is essential for creating durable promises. Idempotent functions can be safely retried without causing unintended side effects, enabling retry mechanisms to recover from transient issues. However, during retries, the function code must remain immutable to prevent versioning conflicts.

// Register `payments` function with a version number of 2,
// a function pointer to a local function,
// and other optionals configurations.
resonate.register(
"payments",
payments,
resonate.options({
version: 2,
timeout: Number.MAX_SAFE_INTEGER,
})
);