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