Code Monkey home page Code Monkey logo

Comments (9)

synodriver avatar synodriver commented on August 17, 2024 1

So regardless thoses extension which is difficult to support, what about other extensions mentioned in asgi spec? Are they possible for the rust server?BTW the easiest extension to implement I think should be lifespan.state, just pass an empty dict to scope is ok, and starlette have already take use of it.

from granian.

gi0baro avatar gi0baro commented on August 17, 2024

@synodriver thank you!

Regarding ASGI extensions, at the moment there are no plans; at least not within the next milestones.
Do you have any specific need/use-case?

from granian.

synodriver avatar synodriver commented on August 17, 2024

Some asgi frameworks use zerocopy extension to serve static files, which can significantly improve the performance, and in some cases the server need to talk to a grpc client directly, which need the trailer header extension. I just forked hypercorn to add all extension support, this may help implementing these extensions for the rust server.

from granian.

gi0baro avatar gi0baro commented on August 17, 2024

So, regarding the two explicit extensions you mentioned:

  • due to Granian architecture the zerocopy extension won't be feasible. Since it is based on file-descriptors, I'm 99% sure it won't be possible to make that descriptor available in a non-blocking and safe fashion to the tokio runtime granian uses behind the scenes
  • regarding trailers, there might be a chance to make 'em work revising the actual ASGI protocol implementation, but since hyper doesn't support them on HTTP/1.1 (hyperium/hyper#2719), they would work only on http2

from granian.

synodriver avatar synodriver commented on August 17, 2024

Thanks for letting me know that since I'm not very familiar with rust. Looks like the asgi spec itself heavily relies on python asyncio implementation, making other languages very hard to implement.

from granian.

gi0baro avatar gi0baro commented on August 17, 2024

Looks like the asgi spec itself heavily relies on python asyncio implementation, making other languages very hard to implement.

Yep. It's even in the first paragraph of RSGI rationale (https://github.com/emmett-framework/granian/blob/master/docs/spec/RSGI.md#rationale) ;)

from granian.

gi0baro avatar gi0baro commented on August 17, 2024

@synodriver sorry for the late reply, I was in PyConIT this weekend and a lot was happening!

I agree lifespan.state would be the easiest and quicker to implement!
Regarding all the others, maybe we can just put together the complete list and for each of them I can tell if feasible or not :)

from granian.

synodriver avatar synodriver commented on August 17, 2024

I agree too. Actually I have send a pr to nginx unit to add lifespan.state support. It was a C project which I can handle, but unfortunately I'm not familiar with rust =(

from granian.

gi0baro avatar gi0baro commented on August 17, 2024

This is now tracked in #93 and #94

from granian.

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.