SocketCluster middleware that queues outgoing publish messages and emits them in batches to avoid overwhelming the socket. Current stable version 0.2.2 (released November 2017). Provides configurable timeout, batch size, and debug mode. Differs from plain socket.publish by batching messages with timeout control, reducing network churn in high-throughput SocketCluster applications. No updates since 2017; works with SocketCluster v5/v6, but not actively maintained.
npm install sc-publish-out-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to attach the publish queue middleware to a SocketCluster worker with custom options.
Upgrade to v0.2.2 or later.
Consider alternative: implement custom batching with sc-channel or raw socket events.
Only use inside SocketCluster worker initialization.
Use: const scPublishOutHandler = require('sc-publish-out-queue'); scPublishOutHandler.attach(worker, options);Run: npm install sc-publish-out-queue --save
Use only inside worker file (e.g., worker.js) where 'worker' is passed to the function.