Git Product home page Git Product logo

Comments (5)

mtiller avatar mtiller commented on May 14, 2024

A related question would be how to integrate websockets, should the need arise?

from huma.

danielgtaylor avatar danielgtaylor commented on May 14, 2024

@mtiller this is something I've been meaning to look into as we may start using SSE in the next few months as well. I don't know whether it is currently possible (it seems like it's not) so maybe we need to add Flusher to the huma.Context interface as a first step.

from huma.

mt35-rs avatar mt35-rs commented on May 14, 2024

What I don't quite get is why the ResponseWriter doesn't already implement the Flusher interface. I'm pretty sure I read that http.ResponseWriter does but it is possible that it could be wrapped by something that doesn't. But I didn't see any case where huma was wrapping it. Just ensuring that the ResponseWriter that is used to compose huma.Context supports Flusher would be sufficient presumably. I wonder if simply nesting the ResponseWriter is somehow interfering with the ability to cast it to Flusher?

from huma.

mt35-rs avatar mt35-rs commented on May 14, 2024

I've added a pull request (#89) that resolves this. If you could merge this, my tests indicate that SSE should work at that point.

from huma.

danielgtaylor avatar danielgtaylor commented on May 14, 2024

Closing as this was resolved in #89 for Huma v1, and Huma v2 has an sse package to enable this functionality at a higher level.

from huma.

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.