flowa
Advanced tools
Comparing version 3.4.0 to 3.4.1
13
index.js
@@ -339,3 +339,3 @@ /** | ||
task = task.bind(new FlowaTask(taskName, runVariables, self)); | ||
task = task.bind(new FlowaTask(taskName, callback, runVariables, self)); | ||
@@ -505,3 +505,3 @@ returnedValue = self._timeout(task, timeout, runVariables, taskName)(runVariables.context, callback); | ||
*/ | ||
function FlowaTask(taskName, runVariables, flowa) { | ||
function FlowaTask(taskName, callback, runVariables, flowa) { | ||
@@ -515,2 +515,8 @@ /** | ||
/** | ||
* The task's callback | ||
* @type {Function} | ||
*/ | ||
this.callback = callback; | ||
/** | ||
* Variables needed for the current run | ||
@@ -542,3 +548,3 @@ * @type {Object} | ||
/** | ||
* Set the execution as terminated | ||
* Set the execution as terminated and call the task's callback | ||
*/ | ||
@@ -548,2 +554,3 @@ FlowaTask.prototype.done = function() { | ||
this._runVariables.terminated = true; | ||
this.callback(); | ||
@@ -550,0 +557,0 @@ }; |
{ | ||
"name": "flowa", | ||
"version": "3.4.0", | ||
"version": "3.4.1", | ||
"description": "Service level control flow for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -130,4 +130,3 @@ /** | ||
context['task' + id] = context['task' + id] ? context['task' + id] + 1 : 1; | ||
this.done(); | ||
setImmediate(callback); | ||
setImmediate(this.done.bind(this)); | ||
}; | ||
@@ -134,0 +133,0 @@ |
245060
3195