Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoroutinePool ¶
type GoroutinePool struct {
// contains filtered or unexported fields
}
GoroutinePool is a goroutine pool.
func NewGoroutinePool ¶
func NewGoroutinePool(maxGoroutineCount int) *GoroutinePool
NewGoroutinePool returns a new goroutine pool. If the max goroutine count is 0, it means no limit.
func NewGoroutinePoolWithoutLimit ¶
func NewGoroutinePoolWithoutLimit() *GoroutinePool
NewGoroutinePoolWithoutLimit returns a new goroutine pool without limit.
func (*GoroutinePool) CurrentGoroutineCount ¶
func (pool *GoroutinePool) CurrentGoroutineCount() int
CurrentGoroutineCount returns the current goroutine count of the pool.
func (*GoroutinePool) Go ¶
func (pool *GoroutinePool) Go(worker func(context.Context) error)
Go adds a new worker to the pool.
func (*GoroutinePool) MaxGoroutineCount ¶
func (pool *GoroutinePool) MaxGoroutineCount() int
MaxGoroutineCount returns the max goroutine count of the pool. If the max goroutine count is 0, it means no limit.
Click to show internal directories.
Click to hide internal directories.