highland-pool

1.2.1 • Public • Published

Highland-pool

Greenkeeper badge

Pool for Highland streams.

Build status

Install

npm install highland-pool

Usage

var Pool = require('highland-pool');

//Make a new pool with maximum 2 streams running at the same time
var pool = Pool(2);

// Pass streams through the pool
var stream1 = pool(someStream());
var stream2 = pool(someStream());
var stream3 = pool(someStream());
var stream4 = pool(someStream());

// Use it as normal highland stream
stream1.pipe(...);
stream2.pipe(...);
stream3.pipe(...);
stream4.pipe(...);

// You can also use it like this:
someStream.through(pool).pipe(...)

Why not .parallel()?

.parallel() can only be used on stream of streams, and pool can be used for any stream. You can pass the pools around, set maximum concurrency on streams in a more flexible way, e.g. pool for reading files from file system.

Readme

Keywords

Package Sidebar

Install

npm i highland-pool

Weekly Downloads

2

Version

1.2.1

License

MIT

Unpacked Size

4.13 kB

Total Files

6

Last publish

Collaborators

  • b123400