flowa
Advanced tools
Comparing version 3.4.1 to 3.5.0
@@ -350,3 +350,4 @@ /** | ||
// Does it return a promise | ||
if (returnedValue instanceof Promise) { | ||
if (typeof returnedValue == 'object' && | ||
'then' in returnedValue && 'catch' in returnedValue) { | ||
@@ -546,3 +547,3 @@ return returnedValue.then(callback.bind(null, null)).catch(callback.bind(null)); | ||
/** | ||
* Set the execution as terminated and call the task's callback | ||
* Set the execution as terminated | ||
*/ | ||
@@ -552,3 +553,2 @@ FlowaTask.prototype.done = function() { | ||
this._runVariables.terminated = true; | ||
this.callback(); | ||
@@ -555,0 +555,0 @@ }; |
{ | ||
"name": "flowa", | ||
"version": "3.4.1", | ||
"version": "3.5.0", | ||
"description": "Service level control flow for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -129,4 +129,8 @@ /** | ||
return function(context, callback) { | ||
var self = this; | ||
context['task' + id] = context['task' + id] ? context['task' + id] + 1 : 1; | ||
setImmediate(this.done.bind(this)); | ||
setImmediate(function() { | ||
self.done(); | ||
callback(); | ||
}); | ||
}; | ||
@@ -133,0 +137,0 @@ |
245338
45
3199