future

package
v0.0.0-...-62694dd Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2018 License: Apache-2.0 Imports: 0 Imported by: 4

Documentation

Overview

Package future implements future/promise primitives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Value

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

Value implements a future/promise for an arbitrary value.

func Immediate

func Immediate(value interface{}) *Value

Immediate returns a Value which resolves to 'value'.

func NewValue

func NewValue(f func() interface{}) *Value

NewValue returns a new Value future, whose value is computed by f(). f() is called concurrently - NewValue doesn't block.

func (*Value) Get

func (f *Value) Get() interface{}

Get returns the value computed by the function given to NewValue. It blocks until the value is ready.

Jump to

Keyboard shortcuts

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