Skip to content

Conversation

@eggyal
Copy link

@eggyal eggyal commented May 29, 2015

The documentation for stream-buffers states:

Disclaimer

Not supposed to be a speed demon, it's more for tests/debugging or weird edge cases. It works with an internal buffer that it copies contents to/from/around.

Moreover, users may wish to stream the results anyway, so buffering and then converting to a string only then to stream therefrom is rather wasteful.

Fixes
@joeybaker
Copy link
Contributor

@eggyal cool!

@joeybaker
Copy link
Contributor

Can you rebase on master (so this can be merged) and add some tests (and some docs)?

@eggyal
Copy link
Author

eggyal commented May 30, 2015

@joeybaker: Rebase, tests and docs all done.

@eggyal
Copy link
Author

eggyal commented May 30, 2015

Hm. There is actually a small problem when using this together with #63, since then the same streams are provided on each rebundle()—yet they will have ended on the first rebundle.

Perhaps instead of passing in an array of streams we should pass in a stream generator function that atomify-js would then call on each rebundle? What do you think, @joeybaker?

joeybaker and others added 12 commits May 30, 2015 18:58
prevents intermittent failures.
The documentation for [`_.values(object)`](https://lodash.com/docs#values) gives an example:

>     _.values(new Foo);
>     // → [1, 2] (iteration order is not guaranteed)

Since "iteration order is not guaranteed", the array of streams passed to factor-bundle may not be in the same order as the corresponding files in `entries`.  Factor bundle [depends on this correlation](https://github.com/substack/factor-bundle/blob/master/index.js#L73) when building its pipeline.

This commit ensures that there is never a mismatch.
The [documentation for `stream-buffers` states](https://github.com/samcday/node-stream-buffer#disclaimer):

> # Disclaimer #
> 
> Not supposed to be a speed demon, it's more for tests/debugging or weird edge cases. It works with an internal buffer that it copies contents to/from/around.

Moreover, users may wish to stream the results anyway, so buffering and then converting to a string only then to stream therefrom is rather wasteful.
@eggyal
Copy link
Author

eggyal commented May 30, 2015

Now using a generator function as described above.

@joeybaker
Copy link
Contributor

@eggyal nifty! The generator function makes a ton sense. My only nit-pick at this point, is that it looks like the rebase pulled in some commits to master. I can fix that up for you if you prefer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants