parallel_machine
Advanced tools
Comparing version 0.3.0 to 0.3.1
{ | ||
"name": "parallel_machine", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Javascript library for distributing tasks over many keys, limiting parallelism for each.", | ||
@@ -34,4 +34,5 @@ "keywords": [ | ||
"build": "rm -rf build/ && ./node_modules/.bin/tsc", | ||
"test": "npm run build && ./node_modules/.bin/mocha" | ||
"lint": "./node_modules/.bin/tslint src/*.ts", | ||
"test": "npm run build && ./node_modules/.bin/mocha && npm run lint" | ||
} | ||
} |
# parallel_machine | ||
[![Build Status](https://travis-ci.org/macobo/parallel_machine.svg?branch=master)](https://travis-ci.org/macobo/parallel_machine) | ||
[![NPM version][npm-image]][npm-url] | ||
@@ -12,5 +13,6 @@ Javascript library for distributing async computation based on a distribution key. | ||
Scenario: we want to run an expensive database migration across many tables in a large database cluster. | ||
To avoid bringing down any single database, we try to distribute the load across all the database clusters via parallel_machine | ||
Scenario: We want to run multiple expensive database migrations across many tables in a large database cluster. | ||
We try to distribute the load across all the database hosts via parallel_machine. This will both minimize the operation time as we'll be doing multiple operations at once whilst avoiding overloading a single host. | ||
```javascript | ||
@@ -30,3 +32,3 @@ var parallel_machine = require("parallel_machine"); | ||
// Key which we distribute over - in this case the host of the task we're about to run. | ||
taskDescriptor: (task) -> task.databaseHost, | ||
taskDescriptor: (task) => task.databaseHost, | ||
// Async function that executes the given task. | ||
@@ -44,1 +46,5 @@ executor: expensiveDatabaseMigration, | ||
``` | ||
[npm-url]: https://npmjs.org/package/parallel_machine | ||
[npm-image]: http://img.shields.io/npm/v/parallel_machine.svg |
@@ -82,3 +82,3 @@ import { expect } from "chai"; | ||
describe("Random fuzz tests", () => { | ||
const mod5 = (n: number) => (n % 5).toString() | ||
const mod5 = (n: number) => (n % 5).toString(); | ||
@@ -85,0 +85,0 @@ it("success case, with data", (done) => { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
48
58866
29
999