Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // GetByte retrieves a byte slice but uses the global pool GetByte = builtinPool.Get // PutByte returns a byte slice but uses the global pool PutByte = builtinPool.Put )
Functions ¶
This section is empty.
Types ¶
type BytePool ¶
type BytePool struct {
// contains filtered or unexported fields
}
Pool consists of 32 sync.Pool, representing byte slices of length from 0 to 32 in powers of 2.
type GoroutinePool ¶ added in v1.1.4
type GoroutinePool struct {
// contains filtered or unexported fields
}
func NewGoroutinePool ¶ added in v1.1.4
func NewGoroutinePool(opts ...Option) *GoroutinePool
func (*GoroutinePool) Schedule ¶ added in v1.1.4
func (p *GoroutinePool) Schedule(task func())
Schedule 执行任务
type Worker ¶ added in v1.1.4
type Worker struct {
// contains filtered or unexported fields
}
func NewWorker ¶ added in v1.1.5
func NewWorker(pool *GoroutinePool, size int) *Worker
type WorkerPool ¶ added in v1.1.4
type WorkerPool interface { Schedule(task func()) Stop() }
Click to show internal directories.
Click to hide internal directories.