Пример #1
0
Файл: ssh.go Проект: 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
}
Пример #2
0
Файл: ssh.go Проект: 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}
}