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

Adjustable durations with ActionChain actions #242

Merged
merged 5 commits into from
Oct 23, 2024

Conversation

0xlunar
Copy link
Contributor

@0xlunar 0xlunar commented Sep 29, 2024

Adds implementation for adjustable action_chain durations mentioned in issue #241

Copy link
Owner

@Vrtgs Vrtgs left a comment

Choose a reason for hiding this comment

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

add better docs as to what duration (Option<u64>) represents

@0xlunar 0xlunar requested a review from Vrtgs October 15, 2024 23:59
@Vrtgs
Copy link
Owner

Vrtgs commented Oct 21, 2024

LGTM

@Vrtgs
Copy link
Owner

Vrtgs commented Oct 21, 2024

or actually, can you make the public API use std::time::Duration, and convert internally using https://doc.rust-lang.org/std/time/struct.Duration.html#method.as_millis
and then u64::try_from(milis).ok()

@Vrtgs
Copy link
Owner

Vrtgs commented Oct 22, 2024

Sorry to do this yet again but I think it would make more sense that you use u64::try_from(milis).ok().unwrap_or(u64::MAX) (or just copy the stdlib but with u64, whichever you prefer)
as having such a long timeout might as well be like waiting an eternity (I mean I think nothing will be around in 5849424 centuries (u64::MAX milis in centuries))

https://github.com/rust-lang/rust/blob/86d69c705a552236a622eee3fdea94bf13c5f102/library/std/src/sys/pal/windows/mod.rs#L312

I think the note should be updated or omitted

@0xlunar
Copy link
Contributor Author

0xlunar commented Oct 23, 2024

Sorry to do this yet again but I think it would make more sense that you use u64::try_from(milis).ok().unwrap_or(u64::MAX) (or just copy the stdlib but with u64, whichever you prefer) as having such a long timeout might as well be like waiting an eternity (I mean I think nothing will be around in 5849424 centuries (u64::MAX milis in centuries))

https://github.com/rust-lang/rust/blob/86d69c705a552236a622eee3fdea94bf13c5f102/library/std/src/sys/pal/windows/mod.rs#L312

I think the note should be updated or omitted

It's all goods, happy to contribute. I went with the unwrap_or(u64::MAX) as was simplest to change and seems reasonably clear.

Copy link
Owner

@Vrtgs Vrtgs left a comment

Choose a reason for hiding this comment

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

LGTM

@Vrtgs Vrtgs merged commit 9cb5ac8 into Vrtgs:main Oct 23, 2024
11 of 12 checks passed
@0xlunar 0xlunar deleted the custom-delay-action-chains branch October 24, 2024 01:06
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