Documentation ¶
Overview ¶
Licensed under the GNU General Public License, version 3 or higher.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchProcessor ¶
type BatchProcessor struct {
// contains filtered or unexported fields
}
A batch processor feeds items into a goroutine for processing.
func NewBatchProcessor ¶
func NewBatchProcessor(callback Callback, maxTasks int) *BatchProcessor
Create a new batch processor.
func (*BatchProcessor) AddBatch ¶
func (this *BatchProcessor) AddBatch(batch Batch)
Adds a batch to the batch processor.
func (*BatchProcessor) Finish ¶
func (this *BatchProcessor) Finish()
Signals that no more batches are incoming, and then waits for batch processing to complete.
func (*BatchProcessor) Terminate ¶
func (this *BatchProcessor) Terminate()
Forcefully terminates batch processing. This only shuts down the worker routine. Individual processing tasks will continue.
Click to show internal directories.
Click to hide internal directories.