Skip to content
You're viewing documentation for v1.1.0. It may be out of date.Go to latest
Email SDK
Esc
↑↓navigate↵open⌘Jpreview
On this page

Timeout plugin

Bound one logical send, including retries and fallback, while preserving caller cancellation.

timeoutPlugin adds an AbortSignal.timeout to every send. When a caller already supplies a signal, the plugin combines both and aborts on whichever happens first.

The timeout covers the whole logical operation after beforeSend begins. It does not reset for each retry or fallback adapter. A timeout surfaces as EmailAbortError and stops routing.

Choose the bound from the user operation

Use a short timeout for request-response flows and a larger timeout in durable workers. The plugin is not a queue deadline and does not cancel a provider request after the provider has already accepted it.

timeoutMs must be a positive finite number. Use a custom id when registering multiple instances for separate composed clients.

Aborted error

Handle caller cancellation and timeout failures.

Production pipeline

Use durable worker deadlines and persisted recovery.

Last updated on