Exemplo n.º 1
0
Arquivo: ssh.go Projeto: Civil/gossh
func NewSshWithMax(max int) (Ssh, error) {
	if max < 1 {
		return nil, fmt.Errorf("Unable to create ssh with %d max resources; max must be a positive number\n", max)
	}
	pool, _ := workpool.NewWorkPoolWithMax(max)
	// error is only returned if max is not positive, so can ignore it
	return &sshProcessImpl{pool: pool}, nil
}
Exemplo n.º 2
0
Arquivo: ssh.go Projeto: Civil/gossh
func NewSsh() Ssh {
	pool, _ := workpool.NewWorkPoolWithMax(MAX_POOL_SIZE)
	// error is only returned if max is not positive, so can ignore it
	return &sshProcessImpl{pool: pool}
}