Sha256: 9c63d6fc99b46fd7e9fe22fcfcb997d59d37fade503a813eb30de2dadad8a074

Contents?: true

Size: 642 Bytes

Versions: 11

Compression:

Stored size: 642 Bytes

Contents

# frozen_string_literal: true

class ThinkingSphinx::RealTime::Processor
  def self.call(indices, &block)
    new(indices).call(&block)
  end

  def initialize(indices)
    @indices = indices
  end

  def call(&block)
    subscribe_to_progress

    indices.each do |index|
      ThinkingSphinx::RealTime.populator.populate index

      block.call
    end
  end

  private

  attr_reader :indices

  def command
    ThinkingSphinx::Commander.call(
      command, configuration, options, stream
    )
  end

  def subscribe_to_progress
    ThinkingSphinx::Subscribers::PopulatorSubscriber.
      attach_to 'thinking_sphinx.real_time'
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
thinking-sphinx-5.6.0 lib/thinking_sphinx/real_time/processor.rb
thinking-sphinx-5.5.1 lib/thinking_sphinx/real_time/processor.rb
thinking-sphinx-5.5.0 lib/thinking_sphinx/real_time/processor.rb
thinking-sphinx-5.4.0 lib/thinking_sphinx/real_time/processor.rb
thinking-sphinx-5.3.0 lib/thinking_sphinx/real_time/processor.rb
thinking-sphinx-5.2.1 lib/thinking_sphinx/real_time/processor.rb
thinking-sphinx-5.2.0 lib/thinking_sphinx/real_time/processor.rb
thinking-sphinx-5.1.0 lib/thinking_sphinx/real_time/processor.rb
thinking-sphinx-5.0.0 lib/thinking_sphinx/real_time/processor.rb
thinking-sphinx-4.4.1 lib/thinking_sphinx/real_time/processor.rb
thinking-sphinx-4.4.0 lib/thinking_sphinx/real_time/processor.rb