viper-app/pkg/chan.go

20 lines
267 B
Go
Raw Normal View History

2023-02-03 16:18:31 +08:00
package pkg
type signal struct{}
var def signal
type SignalChan chan signal
func NewSingleChan() SignalChan {
return make(chan signal)
}
func NewBufferSingleChan(size int) SignalChan {
return make(chan signal, size)
}
func (c SignalChan) Send() {
c <- def
}