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

idea: just use one type of stream #13

Closed
dominictarr opened this issue Nov 2, 2012 · 1 comment
Closed

idea: just use one type of stream #13

dominictarr opened this issue Nov 2, 2012 · 1 comment

Comments

@dominictarr
Copy link
Owner

I want to adjust the protocol so that I only need one type of stream.
you will still replicate with duplex streams...

stream.pipe(scuttlebutt.createStream()).pipe(stream)

but I want to make that work with fs streams also,

var rs = fs.createReadStream(file)
var ss = scuttlebutt.createStream()

rs.pipe(ss)
ss.pause()
rs.on('close', function () {
  ss.pipe(fs.createWriteStream(file, {flags: 'a'}))
})

or, use make a duplex fs stream that works like that...

@dominictarr
Copy link
Owner Author

done

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

1 participant