func NewPool(capacity uint64) (*Pool, error) {
	if capacity <= 0 {
		return nil, ErrInvalidPoolCap
	}
	p := &Pool{
		capacity: capacity,
		status:   RUNNING,
		chTask:   make(chan *Task, capacity),
	}
	return p, nil
}
NewPool init pool
package predator
import (
	"errors"
	"fmt"
	"sync"
	"sync/atomic"
	"time"
	"github.com/rs/zerolog"
)
var (
	ErrInvalidPoolCap = errors.New("invalid pool cap")
	ErrPoolAlreadyClosed = errors.New("pool already closed")
)
const (
	RUNNING = 1
	STOPED  = 0
)
type Task struct {
	crawler *Crawler
	req     *Request
}
type Pool struct {
	capacity       uint64
	runningWorkers uint64
	status         int64
	chTask         chan *Task
	log            zerolog.Logger
	sync.Mutex
}