Documentation ¶
Index ¶
- func Min(x, y int) int
- func ProcessInBatches(items []string, processBatch func([]string) error, batchSize int) (processedBatches int, err error)
- func ProcessInConcurrentBatches(getBatch GenericBatchGetter, processBatch GenericBatchProcessor, ...) (err error)
- type GenericBatchGetter
- type GenericBatchProcessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProcessInBatches ¶
func ProcessInBatches(items []string, processBatch func([]string) error, batchSize int) (processedBatches int, err error)
ProcessInBatches is a generic method that splits the provided items in batches and calls processBatch for each batch
func ProcessInConcurrentBatches ¶
func ProcessInConcurrentBatches(getBatch GenericBatchGetter, processBatch GenericBatchProcessor, batchSize, maxWorkers int) (err error)
ProcessInConcurrentBatches is a generic method to concurrently obtain some resource in batches and then process each batch
Types ¶
type GenericBatchGetter ¶
type GenericBatchGetter func(offset int) (batch interface{}, totalCount int, eTag string, err error)
GenericBatchGetter defines the method signature for a batch getter to obtain a batch of some generic resource
type GenericBatchProcessor ¶
GenericBatchProcessor defines the method signature for a batch processor to process a batch of some generic resource
Click to show internal directories.
Click to hide internal directories.