caolan / caolan/highland

Fork without end

Open
#615 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.4k
Forks
145
PR merge metrics
No merged PRs in 30d

Description

Check a sample below
```
const H = require('highland')

const stream = H([1, 2, 3, 4, 5]).map(String)

const l = stream.fork()
const r = stream.fork()

r.take(2).pipe(process.stdout)
l.pipe(process.stdout)
```
As a result I see:
```
>node test.js
1122
```

Why do I have only two elements from l-stream? How can I achieve behavior when It emits all 5?

I know that it's possible with .observe but in a case I loose back pressure

Contributor guide

Open the contributing guide

Research direction

The issue provides a reproducible Node.js sample using Highland's fork(), take(), pipe(), and observe(). First run the sample, then trace the fork and backpressure behavior; done means the l stream emits all five values without giving up backpressure.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
stream-processing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.