Module: Cabriolet::Parallel
- Defined in:
- lib/cabriolet/parallel.rb
Overview
Parallel extraction for multi-core performance
Defined Under Namespace
Classes: BatchProcessor, Extractor, ThreadPool
Class Method Summary collapse
-
.extract(archive, output_dir, workers: Extractor::DEFAULT_WORKERS, **options) ⇒ Hash
Extract archive using parallel workers.
-
.process_batch(paths, output_base, workers: Extractor::DEFAULT_WORKERS) ⇒ Hash
Process multiple archives in parallel.
Class Method Details
.extract(archive, output_dir, workers: Extractor::DEFAULT_WORKERS, **options) ⇒ Hash
Extract archive using parallel workers
314 315 316 317 318 319 |
# File 'lib/cabriolet/parallel.rb', line 314 def extract(archive, output_dir, workers: Extractor::DEFAULT_WORKERS, **) extractor = Extractor.new(archive, output_dir, workers: workers, **) extractor.extract_all end |
.process_batch(paths, output_base, workers: Extractor::DEFAULT_WORKERS) ⇒ Hash
Process multiple archives in parallel
327 328 329 330 |
# File 'lib/cabriolet/parallel.rb', line 327 def process_batch(paths, output_base, workers: Extractor::DEFAULT_WORKERS) processor = BatchProcessor.new(workers: workers) processor.process_all(paths, output_base) end |