Permalink
Browse files

Remove logging. Add .length

  • Loading branch information...
1 parent 61a578e commit c64ac0d0ccfc22280c86b8264a047fba3b48e3d3 @tim-smart committed Sep 26, 2010
Showing with 7 additions and 3 deletions.
  1. +6 −2 lib/parallel/index.js
  2. +1 −1 package.json
View
@@ -1,7 +1,8 @@
var Task = exports.Task = function Task(actions) {
- this.actions = {};
+ this.actions = {};
this._emitter = new process.EventEmitter();
+ this.length = 0;
if ('object' === typeof actions) {
var keys = Object.keys(actions);
@@ -14,6 +15,10 @@ var Task = exports.Task = function Task(actions) {
};
Task.prototype.add = function add(name, action) {
+ if (!this.actions[name]) {
+ ++this.length;
+ }
+
this.actions[name] = action;
return this;
@@ -47,7 +52,6 @@ Task.prototype.run = function run(callback) {
args.push(function() {
arguments = Array.prototype.slice.call(arguments);
arguments.unshift(key);
- console.log(arguments);
self._emitter.emit.apply(self._emitter, arguments);
callback.apply(self, arguments);
View
@@ -1,7 +1,7 @@
{
"name": "parallel",
"description": "Create tasks in node.js that run in parallel, or sequences that run tasks one after another.",
- "version": "0.1.3",
+ "version": "0.2.0",
"author": "Tim Smart",
"repository": {
"type": "git",

0 comments on commit c64ac0d

Please sign in to comment.