Module: Philiprehberger::Batch
- Defined in:
- lib/philiprehberger/batch.rb,
lib/philiprehberger/batch/chunk.rb,
lib/philiprehberger/batch/result.rb,
lib/philiprehberger/batch/version.rb,
lib/philiprehberger/batch/processor.rb
Defined Under Namespace
Classes: Chunk, Error, Processor, Result
Constant Summary collapse
- VERSION =
'0.4.0'
Class Method Summary collapse
-
.process(collection, size: 100, concurrency: 1, retries: 0, on_progress: nil) {|chunk| ... } ⇒ Result
Process a collection in batches with chunking, progress, and error collection.
Class Method Details
.process(collection, size: 100, concurrency: 1, retries: 0, on_progress: nil) {|chunk| ... } ⇒ Result
Process a collection in batches with chunking, progress, and error collection.
21 22 23 24 |
# File 'lib/philiprehberger/batch.rb', line 21 def self.process(collection, size: 100, concurrency: 1, retries: 0, on_progress: nil, &block) processor = Processor.new(size: size, concurrency: concurrency, retries: retries) processor.call(collection, on_progress: on_progress, &block) end |