Last active
August 29, 2015 13:56
-
-
Save thecodedrift/9338883 to your computer and use it in GitHub Desktop.
Async Tasks and Orchestrator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // I'm pretty sure this is a bad idea | |
| setImmediate(function() { | |
| gulp.task('later', function() { | |
| gulp.src('**/*.txt') | |
| .pipe(gulp.dest('output/')) | |
| }); | |
| }); | |
| // but I really want to... | |
| fs.readFile('some-other-tool.json', function(err, data) { | |
| // do stuff with json | |
| gulp.task('build', function() { | |
| gulp.src(myJson.glob) | |
| .pipe(gulp.dest(output)); | |
| }); | |
| }); | |
| // so should I... | |
| gulp.task('build', function(cb) { | |
| fs.readFile('crap-from-java.json', function(err, data) { | |
| // do stuff with json | |
| gulp.src(myJson.glob) | |
| .pipe(gulp.dest(output)) | |
| .on('stop', cb); // <== would this work the way I think orchestrator does? | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment