Documentation
¶
Overview ¶
Package eventual provides values that eventually have a value.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Getter ¶
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.
func DefaultUnsetGetter ¶
func DefaultUnsetGetter() Getter
DefaultUnsetGetter builds a Getter that always !ok.
type Value ¶
type Value interface {
// Set sets this Value to the given val.
Set(val interface{})
// Get waits up to timeout for the value to be set and returns it, or returns
// nil if it times out or Cancel() is called. valid will be false in latter
// case. If timeout is 0, Get won't wait. If timeout is -1, Get will wait
// forever.
Get(timeout time.Duration) (ret interface{}, valid bool)
// Cancel cancels this value, signaling any waiting calls to Get() that no
// value is coming. If no value was set before Cancel() was called, all future
// calls to Get() will return nil, false. Subsequent calls to Set after Cancel
// have no effect.
Cancel()
}
Value is an eventual value, meaning that callers wishing to access the value block until the value is available.
Click to show internal directories.
Click to hide internal directories.