$ open source · GPL-3.0 — need a commercial license? imqueue.com →

Home > @imqueue/rpc > IMQWrapCall

IMQWrapCall interface

Around hook wrapping the actual service method invocation. It receives the request/response and a next callback that runs the method and resolves to its return value; it MUST call next() (returning its resolved value) to produce the response data. Unlike beforeCall/afterCall, this lets a hook run the method inside its own scope — e.g. establishing an OpenTelemetry context so any spans the method (and its downstream calls) create nest under the request span. When unset, the method is invoked directly.

Signature:

export interface IMQWrapCall<_T>