Batches send() and publish() operations, which makes it faster to send data.
The message, open, and drain callbacks are automatically corked, so you only need to call this if you are sending messages outside of those callbacks or in async functions.
Search the reference...
/
method
Batches send() and publish() operations, which makes it faster to send data.
The message, open, and drain callbacks are automatically corked, so you only need to call this if you are sending messages outside of those callbacks or in async functions.
The callback to run.
ws.cork((ctx) => {
ctx.send("These messages");
ctx.sendText("are sent");
ctx.sendBinary(new TextEncoder().encode("together!"));
});
Resources
ReferenceDocsGuidesDiscordMerch StoreGitHubBlogToolkit
RuntimePackage managerTest runnerBundlerPackage runnerProject
Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco
We're hiring →