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

feat: Add embassy-based sleeper for no_std #173

Merged
merged 8 commits into from
Dec 26, 2024

Conversation

wackazong
Copy link
Contributor

No description provided.

backon/src/blocking_sleep.rs Outdated Show resolved Hide resolved
backon/src/sleep.rs Outdated Show resolved Hide resolved
backon/src/sleep.rs Outdated Show resolved Hide resolved
backon/src/blocking_sleep.rs Outdated Show resolved Hide resolved
backon/src/blocking_sleep.rs Outdated Show resolved Hide resolved
@wackazong
Copy link
Contributor Author

How do you propose to use the EmbassySleeper? I thought the usage of

backon = { version = "x.z", default-features = false, features = ["embassy-sleep"] }

would automatically activate embassy-sleep for the async and the blocking sleeper. That means if the feature embassy-sleep is active, the DefaultSleeper and the DefaultBlockingSleeper should be the embassy sleepers as far as I can see.

Let me know what you think.

@wackazong
Copy link
Contributor Author

Maybe this is a possibility?

@Xuanwo
Copy link
Owner

Xuanwo commented Dec 23, 2024

How do you propose to use the EmbassySleeper?

I expect users to use:

fut.retry(builder).sleeper(EmbassyTimerSleeper).await

@wackazong
Copy link
Contributor Author

I think this is what you want, right?

backon/src/embassy_timer_sleep.rs Outdated Show resolved Hide resolved
backon/src/embassy_timer_sleep.rs Show resolved Hide resolved
backon/src/lib.rs Outdated Show resolved Hide resolved
@Xuanwo Xuanwo changed the title Add embassy-based sleeper for no_std feat: Add embassy-based sleeper for no_std Dec 26, 2024
Copy link
Owner

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @wackazong for building this, really appricated!

@Xuanwo Xuanwo merged commit 1582dbc into Xuanwo:main Dec 26, 2024
7 checks passed
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 this pull request may close these issues.

2 participants