Comparing version 0.0.10 to 0.0.11
{ | ||
"name": "bree", | ||
"description": "The best job scheduler for Node.js with support for cron, ms, and human-friendly strings. Uses workers and spawns sandboxed processes. Supports async/await, retries, throttling, concurrency, and cancelable promises (graceful shutdown). Simple, fast, and the most lightweight tool for the job. Made for Lad.", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)", | ||
@@ -6,0 +6,0 @@ "ava": { |
@@ -242,8 +242,10 @@ # [**bree**](https://github.com/breejs/bree) | ||
// but this is a bit of a cleaner approach for worker termination | ||
parentPort.postMessage('cancelled'); | ||
if (parentPort) parentPort.postMessage('cancelled'); | ||
else process.exit(0); | ||
} | ||
parentPort.once('message', message => { | ||
if (message === 'cancel') return cancel(); | ||
}); | ||
if (parentPort) | ||
parentPort.once('message', message => { | ||
if (message === 'cancel') return cancel(); | ||
}); | ||
``` | ||
@@ -286,5 +288,4 @@ | ||
// signal to parent that the job is done | ||
parentPort.postMessage('done'); | ||
// you could also `process.exit(0);` when done | ||
if (parentPort) parentPort.postMessage('done'); | ||
else process.exit(0); | ||
})(); | ||
@@ -296,3 +297,3 @@ ``` | ||
To close out the worker and signal that it is done, you can simply `parentPort.postMessage('done');` OR `process.exit(0)`. | ||
To close out the worker and signal that it is done, you can simply `parentPort.postMessage('done');` and/or `process.exit(0)`. | ||
@@ -299,0 +300,0 @@ While writing your jobs (which will run in [worker][workers] threads), you should do one of the following: |
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
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
42055
413