Skip to content

Add conversion to SystemTime within ReactionCtx#49

Open
oowekyala wants to merge 1 commit intomainfrom
add-systemtime-conv
Open

Add conversion to SystemTime within ReactionCtx#49
oowekyala wants to merge 1 commit intomainfrom
add-systemtime-conv

Conversation

@oowekyala
Copy link
Collaborator

So with @AneesHl and @cmnrd we talked about replacing the use of Instant with SystemTime within the runtime. One problem of Instant is it is opaque, although it can easily be turned into a Duration (from program startup). With SystemTime we would have a Duration since the Unix Epoch, which helps in the short term with LF-Rust/LF-C interop, and in the long term, maybe with federated execution.

Instead of replacing Instant completely though, I wonder if the following changeset would also do the trick. This just adds a conversion function from Instant to SystemTime using a reference point taken at the startup of the program. The runtime otherwise still uses Instant internally, which is nice because it is monotonic.

@lhstrh lhstrh requested a review from cmnrd May 31, 2024 18:42
Copy link
Contributor

@cmnrd cmnrd left a comment

Choose a reason for hiding this comment

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

Looks good! But it looks like clippy isn't happy with the change.

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