mafintosh / mafintosh/duplexify
race condition
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 191
- Forks
- 35
- PR merge metrics
- No merged PRs in 30d
Description
It seems like you need to call `setReadable` before `setWritable`.
In my case i have a transform stream [trumpet](https://github.com/substack/node-trumpet) that I configure and initialize via an async process.
something like:
``` js
module.exports = function(opts){
var duplexStream = duplexify()
var trumpet = trumpet()
asyncInit(function(){
duplexStream.setReadable(trumpet)
duplexStream.setWritable(trumpet)
})
return duplexStream
}
```
however changing the order means causes it to break ( i think it loses all buffered data ).
``` js
duplexStream.setWritable(trumpet)
duplexStream.setReadable(trumpet)
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the setReadable and setWritable calls in duplexify's async initialization path, using the trumpet transform-stream example as the reproduction. Compare both call orders and investigate whether buffered data is lost when setWritable runs first. Done means initialization works in either order without losing buffered data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100