Giter Site home page Giter Site logo

Comments (4)

WolframHempel avatar WolframHempel commented on May 2, 2024

Deepstream doesn't support HTTP streaming. In browsers that can't establish a WebSocket connection it falls back to XHR long-polling, for everything else it uses a low-level TCP connection which is magnitudes faster.

We've hoped, that between the two we should have every scenario covered. Would you have a special usecase in mind where HTTP streaming is preferable?

from deepstream.io.

Rajan avatar Rajan commented on May 2, 2024

I'd have liked it to try HTTP streaming before falling back to XHR polling. It's because HTTP streaming is supported in most mobile devices and faster than the polling.

I've no problem with falling back to low-level tcp connection, if it works without any extra coding/handling.

from deepstream.io.

WolframHempel avatar WolframHempel commented on May 2, 2024

I completely understand your point, but as deepstream sends many very small messages, keeping the overhead associated with each message as small as possible was one of the crucial aspects of its design. With any kind of HTTP (even chunk encoded streaming approaches) the message's meta data tends to be multiple times the size of the actual message.

This is why we use TCP as preferred transport. It works beautifully and is utilized by most deployments using the NodeJS client. The only consideration that needs to be taken into account is that each TCP packet can contain multiple messages and a message can be split over multiple TCP packets. (Something that will quickly show under load). Hence it's crucial for the client to gather messages and only process them once a message end character (ASCII 30) is received. (See https://github.com/hoxton-one/deepstream.io-client-js/blob/master/src/tcp/tcp-connection.js#L151 for implementation)

from deepstream.io.

WolframHempel avatar WolframHempel commented on May 2, 2024

@Rajan, could you let me know if you're happy for me to close this issue?

from deepstream.io.

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.