Skip to content

feat(client/dispatch): try_poll_ready() methods #3892

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cratelyn
Copy link
Member

this change is motivated by aiming to use interfaces like hyper::client::conn::http2::SendRequest::try_send_request() or hyper::client::conn::http1::SendRequest::try_send_request() in the context of tower middleware; the Service<T> trait's signature is such that the same error type be returned from Service::poll_ready() and Service::call().

this means that services that might resolve to a recovered message may call try_poll_ready when polling for readiness.

this avoids making TrySendError<T> constructable externally, see #3883 as an alternate approach that was considered.

this change is motivated by aiming to use interfaces like
`hyper::client::conn::http2::SendRequest::try_send_request()` or
`hyper::client::conn::http1::SendRequest::try_send_request()` in the
context of tower middleware; the `Service<T>` trait's signature is such
that the same error type be returned from `Service::poll_ready()` and
`Service::call()`.

this means that services that might resolve to a recovered message may
call `try_poll_ready` when polling for readiness.

this avoids making `TrySendError<T>` constructable externally, see hyperium#3883
as an alternate approach that was considered.

Signed-off-by: katelyn martin <[email protected]>
@cratelyn
Copy link
Member Author

ci is failing due to some #[cfg(feature = "httpX")] flags missing.

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.

1 participant