Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IfUnequal ¶
type IfUnequal[T comparable] struct{}
type Value ¶
Value represents a shared value that can be watched for changes. Methods on a Value may be called concurrently.
The zero Value is ok to use; watchers on the zero value will block until Set is called.
U is used to update the value. U.Update must be callable on the zero value of U.
func (*Value[T, U]) Close ¶
Close closes the Value, unblocking any outstanding watchers. Close always returns nil.
func (*Value[T, U]) Get ¶
func (v *Value[T, U]) Get() T
Get returns the current value. If the watcher has been closed, it returns the zero value.
Click to show internal directories.
Click to hide internal directories.