ihrwein / backoff

Exponential backoff and retry for Rust.
https://github.com/ihrwein/backoff
Apache License 2.0
306 stars 37 forks source link

Unnecessary `Send` requirement on `Sleeper::Sleep`? #54

Open jessa0 opened 2 years ago

jessa0 commented 2 years ago

I'm trying to use backoff::future::Retry using gloo-timers::future::TimeoutFuture as Sleeper::Sleep on WASM/Web, which is !Send. Sleeper currently requires type Sleep to be Send, but it seems this is not strictly necessary for the operation of Retry. I do understand, however, it'd technically be a visible API change to remove the Send bound, since the trait is public and not sealed, but it doesn't seem like a breaking change for the intended use of the Sleeper trait.