Giter Club home page Giter Club logo

Comments (3)

kartikk221 avatar kartikk221 commented on May 24, 2024

uWS.write() usage is already implemented in 5.1.2 for streaming and the total_size parameter is now optional. No need to use a Writable as the stream method directly consumes data from the Readable stream and pauses/resumes as uWebsockets allows for more chunks to be served with backpressure handling. You can look at source in src/components/Response.js for how stream method works under the hood. In regards to the actual method returning the actual method returning the Boolean, will get that added in next update.

from hyper-express.

snowbldr avatar snowbldr commented on May 24, 2024

I can't use the response in a pipeline without this...

Also, the express response implements writable, so you don't have parity with express until this is implemented.

I guess I'll use a different framework...

from hyper-express.

kartikk221 avatar kartikk221 commented on May 24, 2024

See 5.3.0 for the new changes in which Response.write() now returns a Boolean similar to Response.send() and other write based methods. Also, Response.drain() has been implemented to work in conjunction with Response.write() when implementing your own backpressure strategy. Also, a Response.writable property has been imlemented which returns a Writable stream associated with the response so you can pipe your readable into it.

The goal with hyper-express is not to have 100% parity with express as uWebsockets.js is fundamentally different from express in how it works and handles the request lifetime flow. Most of the uWebsockets.js methods do not handle backpressure themselves and thus for consistency with the underlying driver of this package, this behavior is extended to the methods of HyperExpress as well.

from hyper-express.

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.