Documentation ¶
Overview ¶
Package wait provides a simple mechanism to wait for a value to be set.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Value ¶
type Value[T any] struct { // contains filtered or unexported fields }
Value is a simple mechanism to wait for a value to be set. It's like semaphore, but for values.
func (*Value[T]) Get ¶
Get waits for the value to be set and returns it. It returns an error if the context is canceled.
func (*Value[T]) Set ¶
func (wv *Value[T]) Set(value T)
Set sets the value and unblocks any waiting goroutines.
Click to show internal directories.
Click to hide internal directories.