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

workerpool

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

workerpool - npm Package Compare versions

Comparing version 2.2.2 to 2.2.3

4

dist/workerpool.js

@@ -7,4 +7,4 @@ /**

*
* @version 2.2.2
* @date 2017-07-08
* @version 2.2.3
* @date 2017-08-19
*

@@ -11,0 +11,0 @@ * @license

@@ -7,4 +7,4 @@ /**

*
* @version 2.2.2
* @date 2017-07-08
* @version 2.2.3
* @date 2017-08-19
*

@@ -11,0 +11,0 @@ * @license

@@ -8,9 +8,14 @@ var workerpool = require('./../index');

pool.proxy().then(function (worker) {
worker.asyncAdd(3, 4.1)
.then(function (result) {
console.log(result);
pool.clear(); // clear all workers when done
});
});
pool.proxy()
.then(function (worker) {
return worker.asyncAdd(3, 4.1);
})
.then(function (result) {
console.log(result);
})
.catch(function (err) {
console.error(err);
})
.then(function () {
pool.clear(); // clear all workers when done
});

@@ -10,4 +10,8 @@ var workerpool = require('./../index');

console.log('Result: ' + result); // outputs 55
})
.catch(function (err) {
console.error(err);
})
.then(function () {
pool.clear(); // clear all workers when done
});

@@ -15,4 +15,8 @@ var workerpool = require('./../index');

console.log('result', result); // outputs 7
})
.catch(function (err) {
console.error(err);
})
.then(function () {
pool.clear(); // clear all workers when done
});

@@ -10,8 +10,12 @@ var workerpool = require('./../index');

// execute a function via the proxy
proxy.fibonacci(10)
.then(function (result) {
console.log('Result: ' + result); // outputs 55
pool.clear(); // clear all workers when done
});
return proxy.fibonacci(10)
})
.then(function (result) {
console.log('Result: ' + result); // outputs 55
})
.catch(function (err) {
console.error(err);
})
.then(function () {
pool.clear(); // clear all workers when done
});

@@ -5,2 +5,7 @@ # workerpool history

## 2017-08-19, version 2.2.3
- Updated all examples to neatly include `.catch(...)` callbacks.
## 2017-07-08, version 2.2.2

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

{
"name": "workerpool",
"version": "2.2.2",
"version": "2.2.3",
"description": "Offload tasks to a pool of workers on node.js and in the browser",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/josdejong/workerpool",

@@ -77,3 +77,7 @@ # workerpool

console.log('result', result); // outputs 7
})
.catch(function (err) {
console.error(err);
})
.then(function () {
pool.clear(); // clear all workers when done

@@ -119,3 +123,7 @@ });

console.log('Result: ' + result); // outputs 55
})
.catch(function (err) {
console.error(err);
})
.then(function () {
pool.clear(); // clear all workers when done

@@ -127,6 +135,12 @@ });

.then(function (worker) {
worker.fibonacci(10)
.then(function (result) {
console.log('Result: ' + result); // outputs 55
});
return worker.fibonacci(10);
})
.then(function (result) {
console.log('Result: ' + result); // outputs 55
})
.catch(function (err) {
console.error(err);
})
.then(function () {
pool.clear(); // clear all workers when done
});

@@ -237,2 +251,5 @@ ```

console.log(result); // will output 6
})
.catch(function (err) {
console.error(err);
});

@@ -247,2 +264,5 @@

console.log(result); // will output 55
})
.catch(function (err) {
console.error(err);
});

@@ -253,6 +273,9 @@

.then(function (myWorker) {
myWorker.fibonacci(10)
.then(function (result) {
console.log(result); // will output 55
});
return myWorker.fibonacci(10)
})
.then(function (result) {
console.log(result); // will output 55
})
.catch(function (err) {
console.error(err);
});

@@ -259,0 +282,0 @@

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