-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
various fixes needed to integrate into surf + tide #44
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't gone through the decoding part super thoroughly. It's a bit difficult to understand and seems to be a bit magical. Is there any way to simplify or make the steps more obvious?
@@ -1,18 +1,19 @@ | |||
//! Process HTTP connections on the client. | |||
|
|||
use async_std::io::{self, BufReader}; | |||
use async_std::io::{self, BufReader, Read}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice actually if we could remove our dependency on async-std and only rely on futures-rs. I don't think this is currently possible because we rely on a timer, but it would be nice to not move away from that direction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rylev we're going to need to use channel
s either way, so we'll have to depend on async-std. And you're right that since we depend on timers we have a dependency either way. I guess the one upside to this though is that it'll work with any runtime out of the box, even if there might be multiple executors running.
|
||
#[async_std::test] | ||
async fn test_basic_request() { | ||
let case = TestCase::new("fixtures/request1.txt", "fixtures/response1.txt").await; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should rename these files to: basic-request.txt
and basic-response.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this is looking really good; a few minor nits but nothing critical. Especially the addition of thorough tests inspires confidence.
Thanks so much @dignifiedquire; this is excellent!
); | ||
}); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All put together this file feels pretty long. Is there perhaps a chance we could split it up into a few smaller parts?
Also as @rylev pointed out there are several instances of mem::replace
that could probably be replaced by reassigning instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pretty large change; it feels like most of the issues have been addressed, and we should be good enough to merge. Excited for this!
With the list of these fun repos I made surf + tide work with async-h1