0.1.0 • Published 7 years ago

flyd-mergeall v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

flyd-mergeAll

Build Status

mergeAll implementation for flyd streams.

It flattens an Stream-of-streams, emitting each time any of the emitted streams emit a value. The parameter concurrency can be added to specify how many streams will be emitting at same time. For instance, if concurrency is 1, the first stream will have to end in order for the second one to emit on the result stream.

([Number] HighOrder-Stream) -> Stream Example without specifying concurrency (all can emit):

a:           {--.-----.--.---.----------.--------}
               [1]   [4 5 6 7 8]      [1 2]
                        [2 4]
                            [3 5 7]
mergeAll(a): {--1-----4-5264738577-----1-2------}

Example with concurrency 1:

a:                 {--.-----.--.---.----------.--------}
                     [1]   [4 5 6 7 8]       [1 2]
                              [2 4]
                                  [3 5 7]
mergeAll(1, a):    {--1-----4-5-6-7-8--7------1-2------}

Usage

0.1.0

7 years ago