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

what about streams? #3

Open
dominictarr opened this issue Oct 19, 2014 · 4 comments
Open

what about streams? #3

dominictarr opened this issue Oct 19, 2014 · 4 comments

Comments

@dominictarr
Copy link

most node apis have a mix of streams and async functions.
So, rpc needs to have remote procedure calls and multiplexing.
or if you use http, then it needs streams at least.

To this end, I recently created this, https://github.com/dominictarr/muxrpc
to be used as part of secure-scuttlebutt.

Like rpc-http, it just takes a list of method names, except it takes multiple lists, to support both async calls and streams. so far muxrpc has async and source (readable) streams, because that is all I have needed so far. I plan to add sink (writable) later.

would you take a pull request that added streams to rpc-http in a compatible way?

@kesla
Copy link
Contributor

kesla commented Oct 19, 2014

I don't know. I'm a bit sceptical to use streams in the browser - you generally don't need the backpressure stuff, so you can often quite easily use something else. Adding streams support in here would mean that browserifying this would include the full readable-stream implementation...

Wouldn't it be doable to have a separate module, extending this, that adds streams - like you did with https://github.com/dominictarr/rpc-with-streams?

@juliangruber
Copy link

this module can be more than limited to browsers as clients

@dominictarr
Copy link
Author

I do not remember writing that!

@juliangruber good point. you could have require("rpc-http/no-stream") and get a browserified version without streams. Or you could use just use classic streams, which are way simpler.

@kesla
Copy link
Contributor

kesla commented Oct 19, 2014

Alright, I'm convinced. Let's go with streams. @dominictarr I like the require("rpc-http/no-stream") approach.

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

3 participants