Documentation
¶
Index ¶
Constants ¶
View Source
const ( // SignalExitSuccess returns when handler function has exited successfully. SignalExitSuccess = 0 // SignalExitFailure returns when handler function raises a panic. SignalExitFailure = 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ISignal ¶
type ISignal interface {
Name() string
Send(args ...interface{})
SendAsync(wait chan int, args ...interface{})
Connect(handler SignalHandler)
}
ISignal is the abstract Signal "class".
type Signal ¶
type Signal struct {
// contains filtered or unexported fields
}
Signal struct holds its receivers.
func NewSignal ¶
func NewSignal(name string, handlers ...SignalHandler) *Signal
NewSignal initializes one new signal instance.
func (*Signal) Connect ¶
func (s *Signal) Connect(handler SignalHandler)
Connect appends one signal handler.
type SignalHandler ¶
type SignalHandler func(ISignal, ...interface{})
SignalHandler type is the abstract handler function.
Click to show internal directories.
Click to hide internal directories.