tower-rs / tower

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

Consider using `ControlFlow` for retry `Policy`. #750

Open LegNeato opened 1 year ago

LegNeato commented 1 year ago

While using an Option for the return value of retry for a Policy is reasonable, it might be clearer to use https://doc.rust-lang.org/std/ops/enum.ControlFlow.html ? Then the break/stop case can return a value too, which might be useful.