Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

race condition #3

Open
kumavis opened this issue May 15, 2015 · 2 comments
Open

race condition #3

kumavis opened this issue May 15, 2015 · 2 comments

Comments

@kumavis
Copy link

kumavis commented May 15, 2015

It seems like you need to call setReadable before setWritable.

In my case i have a transform stream trumpet that I configure and initialize via an async process.

something like:

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 ).

duplexStream.setWritable(trumpet)
duplexStream.setReadable(trumpet)
@mafintosh
Copy link
Owner

sorry missed this. is this using the latest version of trumpet?

@kumavis
Copy link
Author

kumavis commented Jul 28, 2015

yes, 1.7.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants