func ClearEnv(env []string) (ret []string)
ClearEnv removes all items from an environment list that might be interpreted as a notification socket or inherited fd
func DaemonStopping() error
DaemonStopping is used by the child process to indicate it is no longer serving requests and will exit soon.
Listener implements a channel that receives ready notifications from spawned processes
type Listener struct {
// contains filtered or unexported fields
}
func (l *Listener) Attach(cmd *exec.Cmd) (detach func(), err error)
Attach a notification socket to a new child process. The returned "detach" function must be invoked on cleanup, and should be invoked after Start() returns.
func (l *Listener) Close() error
Close shuts down all notification sockets
func (l *Listener) Ready() <-chan int
Ready returns a channel that receives PIDs that are ready
func (l *Listener) Stopping() <-chan int
Stopping returns a channel that receives PIDs that are stopping
type ListenerSet struct {
// contains filtered or unexported fields
}
func NewListenerSet(listeners []net.Listener) (*ListenerSet, error)
NewListenerSet prepares a set of listeners that can be attached to child processes.
The underyling files are duplicated, so the original Listener objects can be closed if desired.
func (s *ListenerSet) Attach(cmd *exec.Cmd) error
Attach all the listeners in the set to a new child process.
func (s *ListenerSet) Close() error
Close frees the extra file descriptors owned by the listener set