Skip to main content

Crate hyperlane_plugin_timeout

Crate hyperlane_plugin_timeout 

Source
Expand description

hyperlane-plugin-timeout

Global and per-prefix request deadline budgets for Hyperlane with X-Request-Timeout header clamping, RequestDeadline context propagation, timeout_future async helper, and automatic 504 Gateway Timeout replies.

Structs§

PrefixTimeout
Per-prefix timeout override entry.
RequestDeadline
Active request deadline metadata stored in Context under ATTR_REQUEST_DEADLINE.
TimeoutConfig
Configuration for TimeoutPlugin.
TimeoutPlugin
Compiled request deadline manager backing TimeoutRequestHook and TimeoutResponseHook.
TimeoutRequestHook
Opt-in request middleware attaching a monotonic RequestDeadline to Context.
TimeoutResponseHook
Opt-in response middleware converting expired deadlines into 504 Gateway Timeout.

Enums§

TimeoutError
Error returned by [timeout_future] when the request deadline elapses.

Constants§

ATTR_REQUEST_DEADLINE
Context attribute key storing the active [RequestDeadline].
DEFAULT_TIMEOUT_BODY
Default JSON body emitted when a request deadline expires.
DEFAULT_TIMEOUT_CONTENT_TYPE
Default Content-Type for expired deadline responses.
DEFAULT_TIMEOUT_HEADER
Default inbound header parsed for client-requested tighter deadlines (x-request-timeout).
DEFAULT_TIMEOUT_MS
Default global request timeout budget in milliseconds (30_000 ms).
HEADER_TIMEOUT_REMAINING_MS
Optional response header recording remaining request budget in milliseconds (x-timeout-remaining-ms).

Functions§

parse_timeout_header_ms
Parses a client timeout header value ("5000", "500ms", "5s") into milliseconds.
timeout_future
Executes future bounded by the RequestDeadline attached to ctx.