github.com/sunvim/utils@v0.1.0/lamport/clock.go (about)

     1  package lamport
     2  
     3  // Time is the value of a Clock.
     4  type Time uint64
     5  
     6  // Clock is a Lamport logical clock
     7  type Clock interface {
     8  	// Time is used to return the current value of the lamport clock
     9  	Time() Time
    10  	// Increment is used to return the value of the lamport clock and increment it afterwards
    11  	Increment() (Time, error)
    12  	// Witness is called to update our local clock if necessary after
    13  	// witnessing a clock value received from another process
    14  	Witness(time Time) error
    15  }