温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/node/diagnostics_channel/Channel/subscribe
点击访问原文链接

Channel.subscribe method | Node.js diagnostics_channel module | Bun

Channel.subscribe method | Node.js diagnostics_channel module | BunBuildDocsReferenceGuidesBlogDiscord/node:diagnostics_channel/Channel/subscribeMsubscribe

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/node:diagnostics_channel/Channel/subscribeMsubscribe

method

diagnostics_channel.Channel.subscribe { // Received data }); ```" data-algolia-static="false" data-algolia-merged="false" data-type="Method">subscribe(onMessage: ChannelListener): void;Register a message handler to subscribe to this channel. This message handler will be run synchronously whenever a message is published to the channel. Any errors thrown in the message handler will trigger an 'uncaughtException'.

import diagnostics_channel from 'node:diagnostics_channel'; const channel = diagnostics_channel.channel('my-channel'); channel.subscribe((message, name) => { // Received data }); @param onMessageThe handler to receive channel messages

Referenced typestype ChannelListener = (message: unknown, name: string | symbol) => void

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco

We're hiring →

智能索引记录