Pluggable clocks in Hydroflow
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.
If we use tokio::time::Instant we should be fine, since Tokio has built in mechanisms for manipulating mock clocks.
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: @.***>
See also https://github.com/hydro-project/hydroflow/issues/1185#issuecomment-2103338235
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.