
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
cluster-file-writer
Advanced tools
This writter attemps to manage two backpressures / bottlenecks in a master / worker scenario where many workers send data to the master to be written to a file.
The first bottleneck is on the file written by the master and it is handled by sending a pause / resume message back to the workers, mimicing a normal stream backpressure behavior.
The second is backpressure from the underlying stream between each worker and master (Assuming the workers pump a lot of data to the master). Unfortunately there is no 'drain' event for communication channel used between the worker and the master (AFAIK it is not properly exposed), so this module tries its best to mimic it using timers.
###Install
npm install cluster-file-writer
###usage
in master
var ClusterFileWriter = require('../lib/ClusterFileWriter');
var master = new ClusterFileWriter.Master('test.log');
in worker
var ClusterFileWriter = require('../lib/ClusterFileWriter');
var worker = new ClusterFileWriter.Worker();
worker.write('yey!');
Data integrity tests are included
###TODO: File name change mid flight needs a test
Backpressure in scenario where master pumps a lot of data to workers
Rewrite tests with mocha
Worker death tests need to be perfected
FAQs
write to a single file from a cluster
The npm package cluster-file-writer receives a total of 2 weekly downloads. As such, cluster-file-writer popularity was classified as not popular.
We found that cluster-file-writer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.