Sha256: 1c2d88a4b8eacf1425d38419aec1ffb261d85276e0631a5aaa8a1da6a40c528c
Contents?: true
Size: 735 Bytes
Versions: 19
Compression:
Stored size: 735 Bytes
Contents
# frozen_string_literal: true module Karafka module Processing # Abstraction layer around workers batch. class WorkersBatch include Enumerable include Helpers::ConfigImporter.new( concurrency: %i[concurrency] ) # @param jobs_queue [JobsQueue] # @return [WorkersBatch] def initialize(jobs_queue) @batch = Array.new(concurrency) { Processing::Worker.new(jobs_queue) } end # Iterates over available workers and yields each worker # @param block [Proc] block we want to run def each(&block) @batch.each(&block) end # @return [Integer] number of workers in the batch def size @batch.size end end end end
Version data entries
19 entries across 19 versions & 1 rubygems