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

parallel_machine

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parallel_machine - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

.vscode/settings.json

6

package.json
{
"name": "parallel_machine",
"version": "0.2.0",
"version": "0.3.0",
"description": "Javascript library for distributing tasks over many keys, limiting parallelism for each.",

@@ -13,4 +13,4 @@ "keywords": [

"license": "MIT",
"main": "src/index.js",
"typings": "src/index.d.ts",
"main": "build/src/index.js",
"typings": "build/src/index.d.ts",
"typescript": {

@@ -17,0 +17,0 @@ "definition": "parallel_machine.d.ts"

@@ -16,3 +16,3 @@ # parallel_machine

```javascript
import * as parallel_machine from "parallel_machine";
var parallel_machine = require("parallel_machine");

@@ -19,0 +19,0 @@ tables = [

@@ -0,1 +1,3 @@

import { ProgressTracker } from "./queue";
export type TaskExecutor<T> = (task: T, callback: (Error?: any) => void) => void;

@@ -9,1 +11,13 @@ export type TaskDescriptor<T> = (task: T) => string;

export type QUEUE_DRAINED = "queue_drained";
export interface IParallelMachineOptions<T> {
// Function which for each task returns it's key (i.e. hostname)
taskDescriptor: TaskDescriptor<T>;
// Async function that executes an action on the target task, calling back once done.
executor: TaskExecutor<T>;
// Up to how many tasks for a given `key` to execute at a time.
keyParallelism: number;
// How many tasks to execute overall. Null or missing means unlimited.
overallParallelism?: number | null;
progressTracker?: ProgressTracker<T>;
}

@@ -1,17 +0,5 @@

import { TaskDescriptor, TaskExecutor } from "./common";
import { AsyncTaskQueue, ProgressTracker, TaskQueue } from "./queue";
import { IParallelMachineOptions, TaskDescriptor, TaskExecutor } from "./common";
import { AsyncTaskQueue } from "./queue";
export interface IParallelMachineOptions<T> {
// Function which for each task returns it's key (i.e. hostname)
taskDescriptor: TaskDescriptor<T>;
// Async function that executes an action on the target task, calling back once done.
executor: TaskExecutor<T>;
// Up to how many tasks for a given `key` to execute at a time.
keyParallelism: number;
// How many tasks to execute overall. Null or missing means unlimited.
overallParallelism?: number | null;
progressTracker?: ProgressTracker<T>;
}
export default function parallel_machine<T>(
function parallel_machine<T>(
tasks: T[],

@@ -33,1 +21,3 @@ options: IParallelMachineOptions<T>,

}
export = parallel_machine;
import { expect } from "chai";
import _ = require("lodash");
import * as _ from "lodash";
import "mocha";
import parallel_machine from "../src";
import parallel_machine = require("../src");
import { TaskDescriptor, TaskExecutor } from "../src/common";

@@ -7,0 +7,0 @@

@@ -8,2 +8,3 @@ {

"sourceMap": true,
"outDir": "build",
"listFiles": true,

@@ -10,0 +11,0 @@ "declaration": true

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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