Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DoFunc ¶
type DoFunc func(code int)
DoFunc is a function that is called when a signal is received.
Parameters:
- code: The code of the signal.
type SignalChannel ¶
type SignalChannel struct {
// contains filtered or unexported fields
}
SignalChannel is a channel for signals.
func NewSignalChannel ¶
func NewSignalChannel(doFunc DoFunc) *SignalChannel
NewSignalChannel creates a new SignalChannel.
Parameters:
- doFunc: The function to call when a signal is received.
Returns:
- *SignalChannel: The new SignalChannel.
Behaviors:
- If doFunc is nil, an empty function is used.
func (*SignalChannel) Send ¶
func (sc *SignalChannel) Send(code int)
Send sends a signal to the SignalChannel.
Parameters:
- code: The code of the signal.
func (*SignalChannel) Wait ¶
func (sc *SignalChannel) Wait()
Wait waits for the SignalChannel to finish.
Click to show internal directories.
Click to hide internal directories.