mafintosh / mafintosh/length-prefixed-stream
cork/uncork in the encoder
- Dominant language
- JavaScript
- Stars
- 46
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Description
in my code I have something like this:
```
something.pipe(lps.encode()).pipe(socket);
```
I think it will make sense to cork/uncork the target stream for the two pushes or push a concat'ed buffer:
```
this.push(pool.slice(used - varint.encode.bytes, used))
this.push(data)
```
Similar issue in another similar library:
https://github.com/rkusa/frame-stream/issues/4
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in the encoder at the two this.push calls shown in the issue, then read the linked frame-stream issue for context on corking or combining output. Done means choosing and implementing the buffering approach while preserving the length-prefixed stream output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100