Skip to content
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

feat(pool): import client::pool from hyper #3

Merged
merged 3 commits into from
Jul 5, 2022

Conversation

dswij
Copy link
Member

@dswij dswij commented Jun 23, 2022

I'm giving hyperium/hyper#2860 a go, but I'm not sure I'm going in the right direction.

Appreciate if you could take a look when you have time @seanmonstar


Some questions:

Some part of pool uses hyper::Errors

error[E0624]: associated function `new_canceled` is private
   --> src/client/pool.rs:592:41
    |
592 | ...                   HyperError::new_canceled().with(CheckoutIsClosedError)
    |                                   ^^^^^^^^^^^^ private associated function
    |
   :::
    |
247 |     pub(super) fn new_canceled() -> Error {
    |     ------------------------------------- private associated function defined here

I'd imagine that it's probably best to expose these functions from hyper::Error, but I'm not sure that this would follow the plan for hyper-util?

@seanmonstar
Copy link
Member

Oh right... Hm, I think this is something we'll need to experiment with, and won't have the full solution when merging this PR, and that's OK. We might just return a hyper::Error created with a Code::CANCELED, but maybe not. It could be that we want a client::pool::Error type that is separate.

It might just be easier to start with returning a Box<dyn std::error::Error + Send + Sync>, and we can change it later once it's been decided.

@dswij dswij marked this pull request as ready for review June 28, 2022 11:14
@dswij dswij changed the title [wip] move pool to hyper-util feat(pool): import client::pool from hyper Jun 28, 2022
@dswij
Copy link
Member Author

dswij commented Jun 30, 2022

I've replaced the hyper::Errors with GenericError for now.

}
}

#[cfg(test)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#[cfg(test)]
#[cfg(all(test, not(miri)))]

Looks like Miri is grumpy with some of the tests in here (sigh). This should make it stop :)

Copy link
Member Author

@dswij dswij Jul 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. b162476

@dswij dswij requested a review from seanmonstar July 5, 2022 10:28
Copy link
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@seanmonstar seanmonstar merged commit 82660d9 into hyperium:master Jul 5, 2022
@dswij dswij deleted the hyper-2860 branch July 6, 2022 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants