eventual

package
v0.0.0-...-fd97e0e Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package eventual provides values that eventually have a value.

Index

Constants

View Source
const (
	FALSE = 0
	TRUE  = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Getter

type Getter func(time.Duration) (interface{}, bool)

Getter is a functional interface for the Value.Get function

func DefaultGetter

func DefaultGetter(val interface{}) Getter

DefaultGetter builds a Getter that always returns the supplied value.

type Value

type Value interface {
	// Set sets this Value to the given val.
	Set(val interface{})

	// Get gets the value, blocks until timeout for a value to become available if
	// one isn't immediately available.
	Get(timeout time.Duration) (interface{}, bool)
}

Value is an eventual value, meaning that callers wishing to access the value block until the value is available.

func NewValue

func NewValue() Value

NewValue creates a new Value.

Jump to

Keyboard shortcuts

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