Documentation ¶
Overview ¶
Package signal provides helpers to allow worker processes to signal to their progenitors that they are ready to receive connections.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsolateProcessGroup ¶
func IsolateProcessGroup() error
IsolateProcessGroup ensures that the current process is a process group leader.
func ListenForWorker ¶
func ListenForWorker(timeout time.Duration) <-chan WorkerState
ListenForWorker waits for a worker process to send it a signal, then uses that to indicate that the worker is ready. If no signal is received before the timeout duration is hit, then a timeout will be indicated via the WorkerState channel.
Regardless, exactly one message will be sent down the returned channel, after which it will be closed.
Types ¶
type WorkerState ¶
type WorkerState int
The worker state: one of WorkerReady or WorkerTimeout.
const ( // The state that indicates that the worker is ready to receive connections. WorkerReady WorkerState = iota // The state indicating that no signal was received before the timeout. WorkerTimeout )
Click to show internal directories.
Click to hide internal directories.