Coder Social home page Coder Social logo

Comments (11)

robertroeser avatar robertroeser commented on May 23, 2024 1

If there's nothing else I recommend closing the issue.

from rsocket-java.

NiteshKant avatar NiteshKant commented on May 23, 2024

My $0.02

ReactiveSocket is a stateful protocol built on top of a long-lived, full-duplex connection which provides a very "conversational" interaction. Few of the benefits of such an interaction are:

  • Bi-directional flow control: request-n down and onNext up.
  • Stream cancellation (unsubscription)
  • Request Leasing.
  • Stream multiplexing on the same connection.

None of the above can be achieved via a stateless, uni-directional (post initial request) protocol such as HTTP/1.1. So, it is not so much about efficiency in this case but just lack of features when running ReactiveSocket over HTTP/1.1.
Running ReactiveSocket in such a degraded mode IMHO doesn't add value. What you are trying to achieve can very much be achieved via HTTP chunking (primarily the streamed responses) and you do not need ReactiveSocket.

from rsocket-java.

vjn avatar vjn commented on May 23, 2024

@NiteshKant, it'd be nice to have the same API, regardless of transport. I believe all of those benefits can be had in HTTP/2. If things can be made to work with 1.1, even if less efficiently, why not? HTTP/1.1 does not have stream multiplexing, of course, but request(n) and cancellation can be made to work.

from rsocket-java.

NiteshKant avatar NiteshKant commented on May 23, 2024

request(n) and cancellation requires signal from the client post request send i.e. interleaved with response stream. How would that work with HTTP/1.1?

from rsocket-java.

vjn avatar vjn commented on May 23, 2024

In the case of HTTP/1.1, a second connection would be required to send the POST, since the original response will be long-running, and kept open.

from rsocket-java.

NiteshKant avatar NiteshKant commented on May 23, 2024

Alright. I will be eager to hear others opinion around here but managing state across different connections IMO gets a bit ugly. YMMV

from rsocket-java.

stevegury avatar stevegury commented on May 23, 2024

HTTP/1 is probably usable if you control the network topology (e.g. guarantee that there isn't any HTTP proxy). But HTTP/2 would definitely be a better fit.

from rsocket-java.

lehecka avatar lehecka commented on May 23, 2024

to @stevegury: I am assuming that you are talking about the case when there is a HTTP proxy, which doesn't understand SSE, buffers the traffic from server to client. Then the response stream from server to client will not flow. Is that what you meant?

from rsocket-java.

stevegury avatar stevegury commented on May 23, 2024

Yes + the fact that if you use two connections, they may not reach the same server.

from rsocket-java.

vjn avatar vjn commented on May 23, 2024

True. I think that complication about the connections not reaching the same back-end server on account of load-balancing is a deal-breaker for HTTP/1.1 in common cases. (I do have an example in mind where this wouldn't be a problem.) So agree, @NiteshKant.

from rsocket-java.

vjn avatar vjn commented on May 23, 2024

Agree, closing the issue.

from rsocket-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.