1.2.1 • Published 1 year ago

highland-pool v1.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
1 year ago

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.

1.2.1

1 year ago

1.2.0

7 years ago

1.1.0

8 years ago

1.0.0

8 years ago