clock

package
v0.0.0-...-2ec8da7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2018 License: GPL-3.0 Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock interface {

	// Time is used to return the current value of the clock
	Now() Time

	// Increment is used to increment and return the value of the clock
	Increment() Time

	// Witness is called to update our local clock if necessary after
	// witnessing a clock value received from another process
	Witness(Time)

	// Clone a clock with the same local time underneath
	Clone() Clock

	// Reset the clock
	Reset()
}

Clock is a thread safe implementation of a clock.

func NewLamportClock

func NewLamportClock() Clock

NewLamportClock creates a new lamport clock

func NewTimeClock

func NewTimeClock() Clock

NewTimeClock creates a new time clock

type Time

type Time interface {
	Value() uint64

	Before(Time) bool

	After(Time) bool
}

Time is the value of a Clock.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL