from batch_processor import BatchProcessor
processor = BatchProcessor(batch_size=10, continue_on_error=true)
items = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
def process_batch(batch):
return [item * 2 for item in batch]
def on_progress(current, total):
print(f'Processing batch {current}/{total}')
results = processor.process(items, process_batch, on_progress)
print(f'Processed {len(results)} batches')