コード例 #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}
}