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

Bi-directional streaming? #181

Open
ioquatix opened this issue Nov 20, 2019 · 3 comments
Open

Bi-directional streaming? #181

ioquatix opened this issue Nov 20, 2019 · 3 comments

Comments

@ioquatix
Copy link

More details here: whatwg/fetch#966 (comment)

I've got a test case for bi-directional streaming using this client/server: https://github.com/socketry/utopia-falcon-heroku/

Request Streaming

Locally (working)

Using the code above:

$ bundle install
$ falcon serve

To start the client:

$ rake echo URL=https://localhost:9292/echo/index

Type some lines and they will be echoed back in real time.

Heroku (not working?)

Run this on the client:

$ rake echo URL=https://utopia-falcon-heroku.herokuapp.com/echo/index

You should be able to type lines and get an interactive response, but it seems like the response is buffered until the request body is completed.

@ferd
Copy link
Contributor

ferd commented Nov 20, 2019

Not a heroku employee here, but that is correct. Vegur does not support bidirectional streaming of that kind with regular HTTP requests; instead it assumes that websockets will be used for that use case.

@ioquatix
Copy link
Author

Thanks for your clarification. There is nothing in the RFC for HTTP/1 or HTTP/2 that prevents bidirectional streaming so it would be great to support it.

@ferd
Copy link
Contributor

ferd commented Nov 20, 2019

HTTP/2 is not supported in Vegur, so that bears no weight with regards to its design.

On the other hand, from what I can recall, the type of error reporting that Heroku does for multiple types of errors do require or are at least facilitated by bidirectional streaming not taking place (i.e. interruption of transfer can result in heroku-inserted error pages), which was inherited from the behaviour of older proxying software.

Other interesting aspects are related to pipelining and the ability to parse and validate content. Part of the response is buffered if it isn't an interruption for some error cases or HTTP 100s being sent, but in some cases it is let through. At the time of writing the software, the Erlang virtual machine was more performant on passive connections (which make it simpler to implement with blocking) and this impacted some of the decisions taken with regards to the implementation along with backwards compatibility.

With performance improvements in the VM, a modern vegur design would probably be different. That being said, I'm no longer working for Heroku (and haven't for roughly 3 years), and I'm not privy to the internal roadmap and engineering effort that will go into this software going forwards.

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