youtime

package
v0.0.0-...-abd3a35 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package youtime provides bounded time uncertainty.

YouTime is roughly inspired by Geng, et al., "Exploitng a Natural Network Effect for Scalable Fine-grained Clock Synchronization," Proc. 15th USENIX Sym. on NSDI, 2018.

https://www.usenix.org/system/files/conference/nsdi18/nsdi18-geng.pdf

Index

Constants

View Source
const CodedProbeInterval = 1 * time.Second

CodedProbeInterval is the time between coded probes.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is an instance of YouTime.

func NewClient

func NewClient(ctx context.Context) *Client

NewClient returns a new YouTime client.

func (*Client) Ready

func (c *Client) Ready()

Ready blocks until the client is ready.

func (*Client) Uncertainty

func (c *Client) Uncertainty() time.Duration

Uncertainty returns the current estimated uncertainty for the YouTimes produced by Get.

type YouTime

type YouTime struct {
	// contains filtered or unexported fields
}

YouTime represents a range of time within which the current time lies.

func (YouTime) EstimatedCommitWait

func (y YouTime) EstimatedCommitWait() time.Duration

EstimatedCommitWait returns the maximum amount of time Time would wait before providing a timestamp.

func (*YouTime) Time

func (y *YouTime) Time() time.Time

Time provides the current time. Time blocks until it can be sure the current time is in the past. That is, after Now returns, no well-synced instance of YouTime will return an earlier time.

Jump to

Keyboard shortcuts

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