truetimeish

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: 1 Imported by: 0

Documentation

Overview

Package truetimeish emulates a TrueTime service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

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

Request is a deferred request for a causal timestamp.

func Get

func Get() Request

Get returns a deferred request for a causal timestamp.

Deferring the request permits clients to perform concurrent work during the commit-wait period. Clients call Timestamp on the TimestampRequest when the actual timestamp value is required.

For performance, clients should call Request as early in the interval within which the timestamp is required (e.g. as soon as all locks are acquired), and clients should call Timestamp on the returned request as late as possible before the timestamp value is required. Doing so reduces the sleep required to ensure timestamp causality.

func (*Request) Timestamp

func (r *Request) Timestamp() time.Time

Timestamp blocks until the deferred timestamp is in the past, and then returns its value.

Jump to

Keyboard shortcuts

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