Documentation ¶
Index ¶
- type Batch
- type Job
- type RebelPool
- type WorkerPool
- func (w *WorkerPool) Add(job Job, amount int)
- func (w *WorkerPool) AddOne(job Job)
- func (w *WorkerPool) CleanBatch(batch string) error
- func (w *WorkerPool) Close()
- func (w *WorkerPool) GetPoolSize() int
- func (w *WorkerPool) GetQueueDepth() int
- func (w *WorkerPool) LoadBatch(name string) (*Batch, error)
- func (w *WorkerPool) NewBatch(name string) (*Batch, error)
- func (w *WorkerPool) NewTempBatch() *Batch
- func (w *WorkerPool) SetPoolSize(size int)
- func (w *WorkerPool) Wait()
- func (w *WorkerPool) WaitBatch(batch string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job interface {
DoWork()
}
Job interface defines a method through which gdw can execute requested jobs.
type RebelPool ¶
type RebelPool struct {
// contains filtered or unexported fields
}
Rebel is used to define a goroutine pool whose purpose is to execute fire-and-forget jobs.
func NewRebelPool ¶
func (*RebelPool) GetPoolSize ¶
func (*RebelPool) GetQueueDepth ¶
func (*RebelPool) SetPoolSize ¶
type WorkerPool ¶
Worker is used to define a goroutine pool whose results and/or execution are of interest, thus awaitable through WaitGroup.
func NewWorkerPool ¶
func NewWorkerPool(size int) *WorkerPool
func (*WorkerPool) Add ¶
func (w *WorkerPool) Add(job Job, amount int)
func (*WorkerPool) AddOne ¶
func (w *WorkerPool) AddOne(job Job)
func (*WorkerPool) CleanBatch ¶
func (w *WorkerPool) CleanBatch(batch string) error
func (*WorkerPool) Close ¶
func (w *WorkerPool) Close()
func (*WorkerPool) GetPoolSize ¶
func (w *WorkerPool) GetPoolSize() int
func (*WorkerPool) GetQueueDepth ¶
func (w *WorkerPool) GetQueueDepth() int
func (*WorkerPool) NewTempBatch ¶
func (w *WorkerPool) NewTempBatch() *Batch
func (*WorkerPool) SetPoolSize ¶
func (w *WorkerPool) SetPoolSize(size int)
func (*WorkerPool) Wait ¶
func (w *WorkerPool) Wait()
func (*WorkerPool) WaitBatch ¶
func (w *WorkerPool) WaitBatch(batch string) error
Click to show internal directories.
Click to hide internal directories.