baconjs/bacon.js — pull request #324 by raimohanska (2014-01-18 18:55:12+00:00)
Title: Add flatMapWithConcurrencyLimit, flatMapConcat and rateLimit

Related to #318 I implemented a `flatMapWithConcurrencyLimit` method that's a flatMap variant that limits the number of open spawned streams. It buffers incoming events to keep from losing any input.

Then I applied the new combinator to create `flatMapConcat` that's just a shorthand for the previous with limit==1. The default flatMap implementation can be thought of "flatMapMerge" because it merges the output of spawned streams.

Finally, I implemented `rateLimit` as a one-liner on top of `flatMapConcat`. This is the combinator that was requested in #317 and once implemented in #82 as "limitThroughPut".

DON'T MERGE YET!

TODO: are the names ok?
TODO: buffer incoming events, not already-created streams
TODO: update readme