Skip to content

InboundWrapper

InboundWrapper = (handler, metadata) => (payload, context) => Promise<any>

Defined in: packages/hoppity/src/interceptors/types.ts:49

Wraps a handler function. Receives the original handler and per-message metadata. Returns a replacement handler with the same signature.

Composition: for interceptors [A, B], the call chain is A → B → handler. A wraps B which wraps the original handler — unwinding goes B → A on return/throw.

Metadata is built per-message because headers vary per message. The wrapper itself is called per-message with fresh metadata each time.

(payload, context) => Promise<any>

InboundMetadata

(payload, context): Promise<any>

any

HandlerContext

Promise<any>