Usage
- Node.js
- Python
Parameters
Deferred events return to the queue after the delay. Any of your client instances sharing the same appKey can receive them.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Postpone event processing with retry logic
subscription.on(async (event) => {
try {
await processPayment(event.payload);
await subscription.ack(event.idem, event.block);
} catch (error) {
// Defer for 5 seconds
await subscription.defer(event.idem, 5000, "Temporary error");
}
});
async def handle_payment(event):
try:
await process_payment(event.payload)
await subscription.ack(event.idem, event.block)
except Exception as error:
# Defer for 5 seconds
await subscription.defer(event.idem, 5000, "Temporary error")
subscription.on(handle_payment)
| Parameter | Type | Required | Description |
|---|---|---|---|
idem | string | Yes | Unique event ID |
delayMs | number | Yes | Delay in milliseconds |
reason | string | No | Optional reason for deferring |