Sends a message to subscribers of the topic.
ServerWebSocket.publish method | Bun module | Bun BuildDocsReferenceGuidesBlogDiscord/Bun/ServerWebSocket/publishMpublish BuildDocsReferenceGuidesBlogDiscord /Bun/ServerWebSocket/publishMpublish ServerWebSocket.publishpublish(topic: string,data: string | BufferSource,compress?: boolean): number; @param topic @param data @param compress Referenced typestype BufferSource = NodeJS.TypedArrayArrayBufferLike> | DataViewArrayBufferLike> | ArrayBufferLike
Search the reference...
/
method
The topic name.
The data to send.
Should the data be compressed? If the client does not support compression, this is ignored.
ws.publish("chat", "Hello!");
ws.publish("chat", "Compress this.", true);
ws.publish("chat", new Uint8Array([1, 2, 3, 4]));
Resources
ReferenceDocsGuidesDiscordMerch StoreGitHubBlogToolkit
RuntimePackage managerTest runnerBundlerPackage runnerProject
Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco
We're hiring →ServerWebSocket.publish method | Bun module | Bun,AI智能索引,全网链接索引,智能导航,网页索引
- API documentation for method bun.ServerWebSocket.publish | Bun