Documentation ¶
Overview ¶
package safe provides a thread-safe holder for a value that may be updated by multiple goroutines.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Safe ¶
type Safe struct {
// contains filtered or unexported fields
}
Safe contains a thread-safe value, also allowing getters to wait until the value is non-nil.
func (*Safe) GetWhenDefined ¶
func (s *Safe) GetWhenDefined() interface{}
GetWhenDefined returns the value, waiting until the value is not nil.
Click to show internal directories.
Click to hide internal directories.