Expand description
Node diagnostics_channel — in-process publish/subscribe named channels.
A channel is a plain object tagged @@native = "Channel" carrying its name
(@@name, also exposed as the enumerable name), a hidden @@subs array of
subscriber callbacks, and a hasSubscribers data property kept in sync as
subscribers come and go. Channels are interned by name in a thread-local
registry so channel('x') === channel('x') and the module-level
subscribe/unsubscribe/hasSubscribers(name, …) operate on the very same
object a caller obtains from channel(name) — matching Node’s guarantee that
a channel is a single shared instance per name.
Scope of fidelity: this is an in-process implementation. publish(msg)
synchronously invokes each subscriber with (message, channelName) (Node’s
contract). It does not span worker threads or processes, and it does not
implement the tracingChannel / async-context store surface. The registry is
process-lifetime; handles are only meaningful within a single program run
(they index the live heap).
Constants§
- METHODS
- TRACING_
CHANNEL_ METHODS - Methods dispatched on an
@@native = "TracingChannel"object (reported to the parent forinstance_has_method/instance_callwiring).
Functions§
- call
- constant
- Non-function members of the
diagnostics_channelnamespace, exposed as constructor values forinstanceof/typeof checks. Reachable vianamespace_propertyIF the parent routes"diagnostics_channel"intostdlib::constant. The channel objects themselves come fromchannel()/tracingChannel(); these bare constructors are not directly instantiable (Node’sChannelconstructor also throws) — they exist so the names resolve. - instance_
call - Instance dispatch for a Channel object (
@@native = "Channel"). - tracing_
instance_ call - Instance dispatch for a
TracingChannelobject (@@native = "TracingChannel").