robrich/orchestrator — pull request #33 by fampinheiro (2014-02-08 02:32:31+00:00)
Title: Allow task start inception

While using gulp I crashed into a `RangeError: Maximum call stack size exceeded`.

The following snippet show how you can achieve it without much effort.

````js
var gulp = require('gulp');
var env = require('gulp-util').env;
var log = require('gulp-util').log;

var a = 0;
gulp.task('root', function() {
gulp.start('task', function() {
gulp.start('task', function (){
gulp.start('final');
});
});
});

gulp.task('task', function() { a++ });
gulp.task('final', function() { log(a); });
gulp.task('default', ['root']);
````

I managed to go down the _packages path_ and I end up on line 150 of [orchestrator](https://github.com/robrich/orchestrator/blob/master/index.js#L150) dependency.

The issue seems to be when the _final_ task is called the callback of the previous one isn't cleaned so it enters in a recursive loop.

This "solution" breaks the test "_orchestrator stop() callback should have error when calling callback too many times_". Any feedback is appreciated.