示例#1
0
func bootNewCommand(slaveNode *processtree.SlaveNode, command string, err error) (*unixsocket.Usock, error) {
	if err != nil {
		return nil, err
	}

	request := &processtree.CommandRequest{command, make(chan *os.File)}
	slaveNode.RequestCommandBoot(request)
	commandFile := <-request.Retchan // TODO: don't really want to wait indefinitely.
	// defer commandFile.Close() // TODO: can't do this here anymore.

	return unixsocket.NewUsockFromFile(commandFile)
}