promise

package
v0.17.3-beta.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2020 License: Apache-2.0 Imports: 0 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LockingMutable

type LockingMutable interface {
	Mutable

	// SetLocked is like Set but the caller must already hold the lock
	SetLocked(interface{})

	// GetLocked is like Get but the caller must already hold the lock
	GetLocked() interface{}
}

LockingMutable is a Mutable whose implementation is protected by a lock

type Mutable

type Mutable interface {

	// Set writes a value into this variable and unblocks every
	// goroutine waiting for this variable to have a value
	Set(interface{})

	// Get reads the value of this variable.  If this variable is
	// not set yet then this call blocks until this variable gets a value.
	Get() interface{}
}

Mutable is a variable that is initially not set and can be set one or more times (unlike a traditional "promise", which can be written only once).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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