hydroflow icon indicating copy to clipboard operation
hydroflow copied to clipboard

Pluggable clocks in Hydroflow

Open rohitkulshreshtha opened this issue 1 year ago • 4 comments

The ability to plug clock implementations in Hydroflow will benefit deterministic (unit) testing. The current implementation binds to Instant::now().

LWW Clock Source (former #1207)

A hybrid-logical clock source that provides a single source of current clock value for each tick.

Should support "ticking" based on current clock value + incoming network messages.

rohitkulshreshtha avatar May 07 '24 21:05 rohitkulshreshtha

If we use tokio::time::Instant we should be fine, since Tokio has built in mechanisms for manipulating mock clocks.

shadaj avatar May 08 '24 22:05 shadaj

That’s a good point. What do we think about the split in executor responsibilities between tokio and hydro flow?

On Wed, May 8, 2024 at 3:58 PM Shadaj Laddad @.***> wrote:

If we use tokio::time::Instant we should be fine, since Tokio has built in mechanisms for manipulating mock clocks.

— Reply to this email directly, view it on GitHub https://github.com/hydro-project/hydroflow/issues/1188#issuecomment-2101633204, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACHWSMKU4P2FUYLHD2OMTLDZBKU3FAVCNFSM6AAAAABHLZOERGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBRGYZTGMRQGQ . You are receiving this because you authored the thread.Message ID: @.***>

rohitkulshreshtha avatar May 08 '24 23:05 rohitkulshreshtha

See also https://github.com/hydro-project/hydroflow/issues/1185#issuecomment-2103338235

shadaj avatar May 09 '24 20:05 shadaj

tokio::time::Instant is similar to std::time::Instant - it is opaque, only meaningful when compared to another instant, and not a wall-clock timestamp.

rohitkulshreshtha avatar May 17 '24 20:05 rohitkulshreshtha