hyper icon indicating copy to clipboard operation
hyper copied to clipboard

feat(client/dispatch): `try_poll_ready()` methods

Open cratelyn opened this issue 5 months ago • 1 comments

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.

cratelyn avatar May 22 '25 20:05 cratelyn