Documentation ¶
Overview ¶
Emit a close function only once, also if called multiple times. This implementation is thread-safe.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Closer ¶
type Closer struct { // Channel which is closed if the closer is closed. IsClosedChan chan struct{} // contains filtered or unexported fields }
func New ¶
func New(f func()) *Closer
New creates a new closer. The passed function is emitted only once, as soon close is called.
Click to show internal directories.
Click to hide internal directories.