tower-rs / tower

async fn(Request) -> Result<Response, Error>
https://docs.rs/tower
MIT License
3.56k stars 281 forks source link

call_all should stop after poll_ready returns an error #706

Closed leoyvens closed 2 years ago

leoyvens commented 2 years ago

The docs say that a service should be discarded after an error is returned from poll_ready. But CallAll will currently treat a poll_ready error in the same way as a request error and continues to call the service. It seems to me that CallAll should instead return the error once and end the stream even if there are more requests to be made.

LucioFranco commented 2 years ago

Yeah, that seems right to me, I would accept a PR for this!