Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Closer ¶
type Closer struct {
// contains filtered or unexported fields
}
Closer implements a primitive to close a channel that signals process termination while allowing a caller to call Close multiple times safely. It should be used in cases where guarantees cannot be made about when and how many times closure is executed.
func (*Closer) Close ¶
func (c *Closer) Close()
Close gracefully closes the Closer. A caller should only call Close once, but it is safe to call it successive times.
func (*Closer) Done ¶
func (c *Closer) Done() <-chan struct{}
Done returns the internal done channel allowing the caller either block or wait for the Closer to be terminated/closed.
func (*Closer) WithCallback ¶
WithCallback adds additional logic to be triggered on the closure of the Closer
Click to show internal directories.
Click to hide internal directories.