Function: trackMessageCorrelation()
Makaio Framework / bus-core / trackMessageCorrelation
Function: trackMessageCorrelation()
Section titled “Function: trackMessageCorrelation()”trackMessageCorrelation<
TMessage>(message,correlations,timeout,signal?):Promise<TMessageextendsBusRequestMessage?unknown:TMessageextendsBusBroadcastMessage?object[] :boolean>
Defined in: ../../../packages/bus-core/src/utils/transport-helpers.ts:132
Track correlation for request/broadcast messages and return appropriate result type.
Behavior by message type:
- Request: Returns promise tracking correlation (resolves to response payload)
- Broadcast: Returns promise tracking correlation (resolves to array of results)
- Other: Returns true immediately (no correlation tracking needed)
Timeout semantics:
Pass 0 to disable automatic timeout — the correlation entry stays open
until resolved or rejected externally. All callers must supply an explicit
value; there is no default so callers cannot accidentally rely on a hidden timeout.
Type Parameters
Section titled “Type Parameters”TMessage
Section titled “TMessage”TMessage extends BusMessage
Parameters
Section titled “Parameters”message
Section titled “message”TMessage
Bus message to process
correlations
Section titled “correlations”Correlation tracker instance
timeout
Section titled “timeout”number
Timeout in milliseconds; 0 means no automatic timeout
signal?
Section titled “signal?”AbortSignal
Optional AbortSignal forwarded to correlation tracking cleanup
Returns
Section titled “Returns”Promise<TMessage extends BusRequestMessage ? unknown : TMessage extends BusBroadcastMessage ? object[] : boolean>
Promise resolving to response data, broadcast results, or boolean