monoio-rs / monoio-http Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
error: concrete type differs from previous defining opaque type use
--> /Users/shabbirhasan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/monoio-http-0.2.3/src/common/body.rs:111:9
|
111 | / async move {
112 | | let buf = self.bytes().await?;
113 | | match encoding.as_str() {
114 | | "gzip" => {
... |
136 | | }
137 | | }
| |_________^ expected `[async block@/Users/shabbirhasan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/monoio-http-0.2.3/src/common/body.rs:68:9: 83:10]`, got `[async block@/Users/shabbirhasan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/monoio-http-0.2.3/src/common/body.rs:111:9: 137:10]`
|
note: previous use here
--> /Users/shabbirhasan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/monoio-http-0.2.3/src/common/body.rs:68:9
|
68 | / async move {
69 | | match self.stream_hint() {
70 | | StreamHint::None => Ok(Bytes::new()),
71 | | StreamHint::Fixed => self
... |
82 | | }
83 | | }
| |_________^
error: could not compile `monoio-http` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...
I have a new proposal for the http1 decoder refactor.
Now h1 decoder is a little bit too complicated, and using Framed causes it to allocate and copy memory, which can be avoided.
When Framed decode something, it calls the decoder to decode an item or tell itself that the buffered data is not sufficient. But, the Framed itself does not know at least how much data it should allocate and read, so it may grow buffer and read many times when the body is big. Also, splitting BytesMut makes it hard to reuse the buffer.
Though the Decoder provides a way(buffer.reverse) to save loop{grow, read}
, it is really not intuitive and does not guarntee the buffer is filled.
The new proposal is to:
The decoder that treats Framed/FramedRead as AsyncReadRent can impl AsyncDecoder of monoio-codec crate. Also, the AsyncDecoder can be improved by changing
fn decode<IO>(&mut self, src: IO) -> Self::DecodeFuture<'_>;
to
fn decode<IO>(&mut self, src: &mut IO) -> Self::DecodeFuture<'_>;
And another thing we can do to monoio-codec is to define a new sync decoder trait, which can tell Framed a more precise hint including the data length.
@ihciah can you pls help implement a tls for http1.1 or http2?
i cant seem to find anything about this for monoio. really looking forward to this implementation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.