gulpjs / undertaker

Task registry that allows composition through series/parallel methods.
MIT License
200 stars 31 forks source link

How to see that all tasks finished? #64

Closed iliakan closed 8 years ago

iliakan commented 8 years ago

That's a follow-up of #55, because the answer to that issue is obviously wrong, it was closed on a mistake.

How to see that all tasks are finished? In Gulp3 it was possible: gulp.on('stop') or gulp.on('err'). But in Gulp4, there seems to be no such way.

An example of a use case would be to disconnect from database when gulp is done or tests are passed.

P.S. process.on('exit') does not help here at all, because the process don't exit when gulp finishes.

P.P.S. I also guess that might be not undertaker-related, but include the overall architecture.

phated commented 8 years ago

The gulp CLI listens to events to do logging, so we are definitely still emitting events. They are going to continue to remain undocumented because we don't want people to use them. To handle this use case, you should just be able to chain .series(allYourTasks, onTotallyDoneCloseConnection)

iliakan commented 8 years ago

I'm running gulp taskA taskB from CLI.

How from inside Gulpfile.js I can see that all tasks are done? Guess, no way, I should make my own way of running tasks, instead of CLI ?