Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cluster-file-writer

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cluster-file-writer - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

28

lib/ClusterFileWriter.js

@@ -18,3 +18,3 @@ var fs = require('fs');

worker.send('cluster-file-writer-resume')
});
});

@@ -33,3 +33,3 @@ cluster.on('disconnect', function(worker) {

if (pausedWorker.id = worker.id) {
if (pausedWorker.id === worker.id) {
self._pausedWorkers = self._pausedWorkers.splice(1, 1);

@@ -51,3 +51,3 @@ console.log('worker found and removed from paused');

this.currentPath = path;
this._log = fs.createWriteStream(path);
this._log = fs.createWriteStream(path);
this._log.on('drain', function () {

@@ -58,3 +58,3 @@

var worker = self._pausedWorkers.pop();
worker.send('cluster-file-writer-resume');
worker.send('cluster-file-writer-resume');
}

@@ -74,5 +74,5 @@ } catch (e) {

if (!resume) {
if (!resume) {
try {
worker.send('cluster-file-writer-pause');
worker.send('cluster-file-writer-pause');
} catch (e) {

@@ -89,3 +89,3 @@ console.log(e);

this._buffer = [];
this._buffer = [];
this._masterPaused = true;

@@ -106,3 +106,3 @@ this._socketPaused = false;

if (this._socketPaused || this._masterPaused) {
this._schedule(message);
this._schedule(message);
} else {

@@ -138,14 +138,14 @@ this._writeImpl(message);

if (this._buffer.length === 0) return;
if (this._masterPaused || this._socketPaused) return;
while (this._buffer.length > 0) {
while (this._buffer.length > 0) {
this._writeImpl(this._buffer.pop());
if (this._masterPaused || this._socketPaused)
break;
}
}
};
Worker.prototype._resume = function () {
this._masterPaused = false;
Worker.prototype._resume = function () {
this._masterPaused = false;
this._flushBuffer();

@@ -152,0 +152,0 @@ };

{
"name": "cluster-file-writer",
"version": "0.0.9",
"description": "write to a single file from a cluster",
"keywords": ["cluster", "logger", "filesystem", "file"],
"main": "index.js",
"author": {
"name": "Yaniv Kessler"
},
"repository": {
"type": "git",
"url": "http://github.co/kessler/cluster-file-writer.git"
},
"bugs": {
"url": "http://github.com/kessler/cluster-file-writer/issues"
},
"licenses": [
{
"type": "MIT",
"url": "https://raw.github.com/kessler/cluster-file-writer/master/LICENSE"
}
],
"devDependencies": {
"byline": "*"
},
"engine": {
"node": ">=0.10"
"name": "cluster-file-writer",
"version": "0.0.10",
"description": "write to a single file from a cluster",
"keywords": [
"cluster",
"logger",
"filesystem",
"file"
],
"main": "index.js",
"author": {
"name": "Yaniv Kessler"
},
"repository": {
"type": "git",
"url": "http://github.co/kessler/cluster-file-writer.git"
},
"bugs": {
"url": "http://github.com/kessler/cluster-file-writer/issues"
},
"licenses": [
{
"type": "MIT",
"url": "https://raw.github.com/kessler/cluster-file-writer/master/LICENSE"
}
}
],
"devDependencies": {
"byline": "*"
},
"engine": {
"node": ">=0.10"
},
"dependencies": {}
}

@@ -35,8 +35,11 @@ Cluster file writer

Data integrity tests are included
Data integrity tests are included
###TODO:
Worker death tests need to be perfected
File name change mid flight needs a test
Backpressure in scenario where master pumps a lot of data to workers
Backpressure in scenario where master pumps a lot of data to workers
Rewrite tests with mocha
Worker death tests need to be perfected
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc