|
package terminal
|
|
|
|
func newNotifier() *notifier {
|
|
return ¬ifier{
|
|
C: make(chan struct{}, 1),
|
|
}
|
|
}
|
|
|
|
type notifier struct {
|
|
C chan struct{}
|
|
}
|
|
|
|
// Notify is used to signal an event in a non-blocking way.
|
|
func (n *notifier) Notify() {
|
|
select {
|
|
case n.C <- struct{}{}:
|
|
default:
|
|
}
|
|
}
|