CallHooks interface

The pair of hooks @imqueue/rpc invokes around a call. Structurally equal to IMQBeforeCall/IMQAfterCall, but expressed without a type parameter so the same shape works for both client and service option objects.

Signature:

export interface CallHooks 

Properties

Property

Modifiers

Type

Description

afterCall

(req?: IMQRPCRequest, res?: any) => Promise<void>

Runs after the call. Publishes error when the response carries one, then always publishes finish so the span is closed either way.

beforeCall

(req?: IMQRPCRequest, res?: any) => Promise<void>

Runs before the call. Builds the call context, attaches it to the request, and publishes the start event. Returns immediately when the channel has no subscribers.

Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.