squeaky-pl / japronto

Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.
MIT License
8.62k stars 580 forks source link

How to make receiving body in request awaitable? #161

Open IterableTrucks opened 4 years ago

IterableTrucks commented 4 years ago

Is it possible to make request.body an asynchronous function so that we can use something like "text=await request.text()" in the handler?

squeaky-pl commented 4 years ago

This is not something that Japronto was made for and I purposefully skipped it. Japronto is made for fast turn over small request small response usage scenario.

If you need to wait for your body to arrive due to slow network and client you are better off with general frameworks because latencies and wait times would totally kill speed benefits.