Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Listener ¶
type Listener interface { // Receive returns the receive only channel from where the signals will be // written to. Receive() <-chan os.Signal // Stop stops listening the signal. Stop() }
Listener abstracts the behavior of a `signal.Notify` and `signal.Reset`.
The idea is to `signal.Notify` will be called at the initialization at the implementation.
func NewListener ¶
NewListener returns the default implementation of a `Listener`.
type Waiter ¶
type Waiter interface {
Wait()
}
Waiter implements a locking mechanism that can be called multiples, locking multiple goroutines, and unblocks all at once when a signal arrives.
Internally it uses the Listener.Receives alongside a multiple
func NewWaiterWithListener ¶
NewWaiterWithListener creates a new Waiter with the given Listener.
Click to show internal directories.
Click to hide internal directories.