Skip to content
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

Why not using futures-timer ? #153

Open
NumberFour8 opened this issue Oct 16, 2024 · 3 comments · May be fixed by #154
Open

Why not using futures-timer ? #153

NumberFour8 opened this issue Oct 16, 2024 · 3 comments · May be fixed by #154

Comments

@NumberFour8
Copy link

NumberFour8 commented Oct 16, 2024

The futures-timer (https://crates.io/crates/futures-timer) crate is runtime agnostic and also supports gloo-timers for WASM environments.

Why not using that one instead of gloo-timers directly? This also covers the cases, when e.g. someone is not using tokio, but async-std.

@Xuanwo
Copy link
Owner

Xuanwo commented Oct 17, 2024

Hi, thank you first for raising this.

All timer (a.k.a sleeper in this project) implementation are optional. Feel free to contribute futures-timer support if you are interested.

@NumberFour8
Copy link
Author

Ok, thanks for your response!
I will prepare a PR which adds the futures-timer support then :)

NumberFour8 added a commit to NumberFour8/backon that referenced this issue Oct 17, 2024
- Migrated Sleeper implementation from `gloo-timers` to async runtime-agnostic `futures-timer`

- Adjusted feature flags and updated dependencies to reflect this change, ensuring seamless functionality across different environments:

  - `gloo-timers-sleep` feature kept for backwards compatibility, it will imply the automatically `futures-timer-sleep`

  - if `wasm32` architecture is detected, it automatically enables the `gloo-timers` feature on `futures-timer` crate to ensure WASM compatibility.

Closes Xuanwo#153
@NumberFour8 NumberFour8 linked a pull request Oct 17, 2024 that will close this issue
@NumberFour8
Copy link
Author

Comments on what to improve are welcome: #154

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 a pull request may close this issue.

2 participants