Giter Club home page Giter Club logo

Comments (7)

conico974 avatar conico974 commented on June 27, 2024 2

Definitely interested in this.
One of the issue with lambda response streaming as of now is that it only support lambda function url.
I've started playing with it yesterday to see if it would be difficult to support and it should not be to difficult, but we need to figure out how to support both edge and standard lambda : conico974@688150d

from open-next.

khuezy avatar khuezy commented on June 27, 2024

@conico974 were you able to cache the streamed data? I tried playing w/ streaming in server-adapter but the content type ended up being an octet-stream

from open-next.

conico974 avatar conico974 commented on June 27, 2024

Yes it was kind of working, i hacked something here : https://github.com/conico974/open-next/blob/688150d0a09d78a12f0ba926097c8282b6ec2745/packages/open-next/src/adapters/response.ts#L85 to set the content type.
This was the only way i found to set the headers on the response stream, but i haven't looked too much into this.

There is also a setContentType method on the responseStream object but we need to call this before writing anything to the stream, otherwise it will log an error and set the content type to octet-stream

from open-next.

DavidHooper avatar DavidHooper commented on June 27, 2024

@conico974 I've forked your commit and investigating further. Found this function sets content type after the stream has already been written to.
https://gist.github.com/magJ/63bac8198469b6a25d5697ad490d31e6#file-index-mjs-L806

from open-next.

conico974 avatar conico974 commented on June 27, 2024

@DavidHooper Nice catch looking at the runtime.
This function is actually called from user code, so it's likely something i have done or that you've done.
Looking at the gist, the response stream provided to us is actually https://gist.github.com/magJ/63bac8198469b6a25d5697ad490d31e6#file-index-mjs-L197.
We should probably rewrite the response class from open-next around that class

from open-next.

ian-pascoe avatar ian-pascoe commented on June 27, 2024

Is there any update on this? I would love to see it implemented!

from open-next.

khuezy avatar khuezy commented on June 27, 2024

@passgoco https://discord.com/channels/983865673656705025/1027265626085019769/1149742408565800990
Still experimental, chunks aren't compressed, we're looking into rewriting the http server. Help us if you can.

from open-next.

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.