Sha256: 6b1fd9f0207846882634d6b2f08509be3586334589224bd0ff6e5ffb953af57c

Contents?: true

Size: 859 Bytes

Versions: 28

Compression:

Stored size: 859 Bytes

Contents

module Backburner
  module Workers
    class Simple < Worker
      # Used to prepare job queues before processing jobs.
      # Setup beanstalk tube_names and watch all specified tubes for jobs.
      #
      # @raise [Beaneater::NotConnected] If beanstalk fails to connect.
      # @example
      #   @worker.prepare
      #
      def prepare
        self.tube_names.map! { |name| expand_tube_name(name)  }.uniq!
        log_info "Working #{tube_names.size} queues: [ #{tube_names.join(', ')} ]"
#        self.connection.tubes.watch!(*self.tube_names)
      end

      # Starts processing new jobs indefinitely.
      # Primary way to consume and process jobs in specified tubes.
      #
      # @example
      #   @worker.start
      #
      def start
        prepare
        loop { work_one_job }
      end
    end # Basic
  end # Workers
end # Backburner

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
backburner-allq-1.0.50 lib/backburner/workers/simple.rb
backburner-allq-1.0.49 lib/backburner/workers/simple.rb
backburner-allq-1.0.48 lib/backburner/workers/simple.rb
backburner-allq-1.0.47 lib/backburner/workers/simple.rb
backburner-allq-1.0.46 lib/backburner/workers/simple.rb
backburner-allq-1.0.45 lib/backburner/workers/simple.rb
backburner-allq-1.0.44 lib/backburner/workers/simple.rb
backburner-allq-1.0.40 lib/backburner/workers/simple.rb
backburner-allq-1.0.39 lib/backburner/workers/simple.rb
backburner-allq-1.0.38 lib/backburner/workers/simple.rb
backburner-allq-1.0.37 lib/backburner/workers/simple.rb
backburner-allq-1.0.36 lib/backburner/workers/simple.rb
backburner-allq-1.0.35 lib/backburner/workers/simple.rb
backburner-allq-1.0.34 lib/backburner/workers/simple.rb
backburner-allq-1.0.33 lib/backburner/workers/simple.rb
backburner-allq-1.0.32 lib/backburner/workers/simple.rb
backburner-allq-1.0.31 lib/backburner/workers/simple.rb
backburner-allq-1.0.29 lib/backburner/workers/simple.rb
backburner-allq-1.0.28 lib/backburner/workers/simple.rb
backburner-allq-1.0.27 lib/backburner/workers/simple.rb