method
diagnostics_channel.BoundedChannel.subscribe
): void;
Subscribe to the bounded channel events. This is equivalent to calling [channel.subscribe(onMessage)][] on each channel individually.
import { boundedChannel } from 'node:diagnostics_channel';
const wc = boundedChannel('my-operation');
wc.subscribe({
start(message) {
// Handle start
},
end(message) {
// Handle end
},
});@param handlers
Set of channel subscribers