taskgroup
Advanced tools
Comparing version 5.0.2 to 5.1.0
@@ -28,2 +28,3 @@ /* eslint no-extra-parens:0 func-style:0 */ | ||
var eachr = require('eachr'); | ||
var unbounded = require('unbounded'); | ||
@@ -517,3 +518,4 @@ /** | ||
else if (this.config.errorOnExcessCompletions) { | ||
var completedError = new Error('The task [' + this.names + '] just completed, but it had already completed earlier, this is unexpected.'); | ||
var source = (this.config.method.unbounded || this.config.method || 'no longer present').toString(); | ||
var completedError = new Error('The task [' + this.names + '] just completed, but it had already completed earlier, this is unexpected.\nTask Source: ' + source); | ||
this.emit('error', completedError); | ||
@@ -568,3 +570,3 @@ } | ||
var taskDomain = this.state.taskDomain; | ||
var exitMethod = this.itemCompletionCallback.bind(this); | ||
var exitMethod = unbounded.binder.call(this.itemCompletionCallback, this); | ||
var method = this.config.method; | ||
@@ -580,3 +582,3 @@ | ||
// Bind method | ||
method = method.bind(this); | ||
method = unbounded.binder.call(method, this); | ||
@@ -583,0 +585,0 @@ // Handle domains |
@@ -30,2 +30,3 @@ /* eslint no-extra-parens:0 */ | ||
var eachr = require('eachr'); | ||
var unbounded = require('unbounded'); | ||
@@ -520,3 +521,3 @@ /** | ||
// As tasks inside nested taskgroups will fire in any order | ||
queue(_this.autoRun.bind(_this)); | ||
queue(unbounded.binder.call(_this.autoRun, _this)); | ||
return _this; | ||
@@ -744,3 +745,3 @@ } | ||
method = method.bind(this); // run the taskgroup method on the group, rather than itself | ||
method = unbounded.binder.call(method, this); // run the taskgroup method on the group, rather than itself | ||
method.isTaskGroupMethod = true; | ||
@@ -747,0 +748,0 @@ if (!opts.name) opts.name = 'taskgroup method for ' + this.name; |
# History | ||
## v5.1.0 2018 July 13 | ||
- Add support for [unbounded](https://github.com/bevry/unbounded) | ||
- If a task completed, but had already completed earlier, we will now try to output the task's source for easier debugging | ||
## v5.0.2 2018 July 13 | ||
@@ -4,0 +8,0 @@ - Updated base files using [boundation](https://github.com/bevry/boundation) |
{ | ||
"title": "TaskGroup", | ||
"name": "taskgroup", | ||
"version": "5.0.2", | ||
"version": "5.1.0", | ||
"description": "Group together synchronous and asynchronous tasks and execute them with support for concurrency, naming, and nesting.", | ||
@@ -102,3 +102,4 @@ "homepage": "ssh://git@github.com/bevry/taskgroup", | ||
"editions": "^1.3.4", | ||
"extendr": "^3.2.2" | ||
"extendr": "^3.2.2", | ||
"unbounded": "^1.1.0" | ||
}, | ||
@@ -105,0 +106,0 @@ "devDependencies": { |
@@ -46,3 +46,3 @@ <!-- TITLE/ --> | ||
<li>Module: <code>require('taskgroup')</code></li> | ||
<li>CDN URL: <code>//wzrd.in/bundle/taskgroup@5.0.2</code></li></ul> | ||
<li>CDN URL: <code>//wzrd.in/bundle/taskgroup@5.1.0</code></li></ul> | ||
@@ -100,3 +100,3 @@ <a href="http://enderjs.com" title="Ender is a full featured package manager for your browser"><h3>Ender</h3></a><ul> | ||
<ul><li><a href="http://balupton.com">Benjamin Lupton</a> — <a href="https://github.com/bevry/taskgroup/commits?author=balupton" title="View the GitHub contributions of Benjamin Lupton on repository bevry/taskgroup">view contributions</a></li></ul> | ||
<ul><li><a href="http://balupton.com">Benjamin Lupton</a></li></ul> | ||
@@ -118,6 +118,6 @@ <h3>Sponsors</h3> | ||
<ul><li><a href="http://balupton.com">Benjamin Lupton</a> — <a href="https://github.com/bevry/taskgroup/commits?author=balupton" title="View the GitHub contributions of Benjamin Lupton on repository bevry/taskgroup">view contributions</a></li> | ||
<ul><li><a href="http://balupton.com">Benjamin Lupton</a></li> | ||
<li><a href="https://github.com/crito">crito</a> — <a href="https://github.com/bevry/taskgroup/commits?author=crito" title="View the GitHub contributions of crito on repository bevry/taskgroup">view contributions</a></li> | ||
<li><a href="https://github.com/pflannery">Peter Flannery</a> — <a href="https://github.com/bevry/taskgroup/commits?author=pflannery" title="View the GitHub contributions of Peter Flannery on repository bevry/taskgroup">view contributions</a></li> | ||
<li><a href="http://seanfridman.com">Sean Fridman</a> — <a href="https://github.com/bevry/taskgroup/commits?author=sfrdmn" title="View the GitHub contributions of Sean Fridman on repository bevry/taskgroup">view contributions</a></li></ul> | ||
<li><a href="http://seanfridman.com">Sean Fridman</a></li></ul> | ||
@@ -124,0 +124,0 @@ <a href="https://github.com/bevry/taskgroup/blob/master/CONTRIBUTING.md#files">Discover how you can contribute by heading on over to the <code>CONTRIBUTING.md</code> file.</a> |
@@ -10,2 +10,3 @@ /* eslint no-extra-parens:0 func-style:0 */ | ||
const eachr = require('eachr') | ||
const unbounded = require('unbounded') | ||
@@ -431,3 +432,4 @@ /** | ||
else if (this.config.errorOnExcessCompletions) { | ||
const completedError = new Error(`The task [${this.names}] just completed, but it had already completed earlier, this is unexpected.`) | ||
const source = (this.config.method.unbounded || this.config.method || 'no longer present').toString() | ||
const completedError = new Error(`The task [${this.names}] just completed, but it had already completed earlier, this is unexpected.\nTask Source: ${source}`) | ||
this.emit('error', completedError) | ||
@@ -474,3 +476,3 @@ } | ||
let taskDomain = this.state.taskDomain | ||
const exitMethod = this.itemCompletionCallback.bind(this) | ||
const exitMethod = unbounded.binder.call(this.itemCompletionCallback, this) | ||
let method = this.config.method | ||
@@ -486,3 +488,3 @@ | ||
// Bind method | ||
method = method.bind(this) | ||
method = unbounded.binder.call(method, this) | ||
@@ -489,0 +491,0 @@ // Handle domains |
@@ -10,2 +10,3 @@ /* eslint no-extra-parens:0 */ | ||
const eachr = require('eachr') | ||
const unbounded = require('unbounded') | ||
@@ -404,3 +405,3 @@ /** | ||
// As tasks inside nested taskgroups will fire in any order | ||
queue(this.autoRun.bind(this)) | ||
queue(unbounded.binder.call(this.autoRun, this)) | ||
} | ||
@@ -613,3 +614,3 @@ | ||
addMethod (method, opts = {}) { | ||
method = method.bind(this) // run the taskgroup method on the group, rather than itself | ||
method = unbounded.binder.call(method, this) // run the taskgroup method on the group, rather than itself | ||
method.isTaskGroupMethod = true | ||
@@ -616,0 +617,0 @@ if (!opts.name) opts.name = 'taskgroup method for ' + this.name |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
143098
3495
0
5
12
+ Addedunbounded@^1.1.0
+ Addedunbounded@1.3.0(transitive)