Sha256: 71a3521467a46a545fcac4deb8f104044c914975cc16aef0d6fbcb069fa8e647

Contents?: true

Size: 805 Bytes

Versions: 23

Compression:

Stored size: 805 Bytes

Contents

require 'alephant/logger'
require 'alephant/broker/component'
require 'pmap'

module Alephant
  module Broker
    module Request
      class Batch
        include Logger

        attr_reader :batch_id, :components, :load_strategy

        def initialize(component_factory, env)
          logger.info "Request::Batch#initialize: id: #{env.data['batch_id']}"

          @batch_id          = env.data['batch_id']
          @component_factory = component_factory
          @components        = components_for env
        end

        private

        def components_for(env)
          env.data['components'].pmap do |c|
            @component_factory.create(
              c['component'],
              batch_id,
              c['options']
            )
          end
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
alephant-broker-3.9.2 lib/alephant/broker/request/batch.rb
alephant-broker-3.9.1 lib/alephant/broker/request/batch.rb
alephant-broker-3.9.0 lib/alephant/broker/request/batch.rb
alephant-broker-3.8.0 lib/alephant/broker/request/batch.rb
alephant-broker-3.7.1 lib/alephant/broker/request/batch.rb
alephant-broker-3.7.0 lib/alephant/broker/request/batch.rb
alephant-broker-3.6.1 lib/alephant/broker/request/batch.rb
alephant-broker-3.6.0 lib/alephant/broker/request/batch.rb
alephant-broker-3.5.5 lib/alephant/broker/request/batch.rb
alephant-broker-3.5.4 lib/alephant/broker/request/batch.rb
alephant-broker-3.5.3 lib/alephant/broker/request/batch.rb
alephant-broker-3.5.2 lib/alephant/broker/request/batch.rb
alephant-broker-3.5.1 lib/alephant/broker/request/batch.rb
alephant-broker-3.5.0 lib/alephant/broker/request/batch.rb
alephant-broker-3.4.1 lib/alephant/broker/request/batch.rb
alephant-broker-3.4.0 lib/alephant/broker/request/batch.rb
alephant-broker-3.3.2 lib/alephant/broker/request/batch.rb
alephant-broker-3.3.1 lib/alephant/broker/request/batch.rb
alephant-broker-3.3.0 lib/alephant/broker/request/batch.rb
alephant-broker-3.2.0 lib/alephant/broker/request/batch.rb