New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parallel piping #879
Comments
I have no clue what is trying to be achieved here and it doesn't look like an idiomatic gulpfile so not sure what can be done. :( |
@phated Yeah, I guess a dump of code isn't too easy to understand haha. if I have only one set of files to inject into my
Now if I have another source, I could do something like this
and so on. That is done in series. My |
@boogerlad In series? What makes you think so? |
In the example code, two |
Okay I am not a smart person. Thank you for correcting me @heikki Please forgive me for asserting that it was done in series. |
This is a very old issue but I just ran into this. I have been under the impression that Here's a quick test case with gulp version 4.0.2: I have a dir called import * as gulp from 'gulp';
import { obj as through } from 'through2';
import log from 'fancy-log';
gulp.task('test', () => gulp.src('temp/**/*')
.pipe(through((file, encoding, callback) => {
log(`Start transform '${file.relative}'`);
setTimeout(() => {
log(`End transform '${file.relative}: ${file.contents.toString()}`);
callback(null, file);
}, 3000);
}))
); The output from the gulp task:
I would expect all of the "Start transform" logs to happen instantly and then all the "End transform" logs after 3 seconds. However it takes 3 second for each of the transforms to complete sequentially before starting the next one. |
Okay so it seems that my problem was that I was using import * as gulp from 'gulp';
import transform from 'parallel-transform';
import log from 'fancy-log';
gulp.task('test', () => gulp.src('temp/**/*')
.pipe(transform(10, (file, callback) => {
log(`Start transform '${file.relative}'`);
setTimeout(() => {
log(`End transform '${file.relative}: ${file.contents.toString()}`);
callback(null, file);
}, 3000);
}))
); We get the following output:
So in short: nothing wrong with |
Hi I'm using 4.0.0-alpha1 (00cd1fd) and am wondering if there is a way to do parallel piping? Right now,
inject
injects script/stylesheet tags sequentially. First it'll docss
, and then it'll dojs
. However,css
andjs
have no relationship! It doesn't make sense to wait for the tasks to finish sequentially.I've come close to doing it in parallel by using
bach.parallel
and thenmerge-stream
ing the result, but the problem is since I'm not returning a stream, the task will never be complete. I will get this outputfor
here's the default task
Now you're probably wondering why I can't just do
I could, but then I would have to glob the files again and somehow enforce an order. The
css
task and thejs
task have already done the work so why duplicate it?The text was updated successfully, but these errors were encountered: