class Doctrine::Worker

public

Public Class Methods

new(queue:, runner:) click to toggle source
# File lib/doctrine/worker.rb, line 7
def initialize(queue:, runner:)
  @queue = queue
  @runner = runner
end

Public Instance Methods

run() click to toggle source
public
# File lib/doctrine/worker.rb, line 14
def run
  until @queue.closed?
    if (run = @queue.pop)
      begin
        @runner.starting(run)

        run.perform
      rescue => error
        run.errored(error)
      ensure
        @runner.finished(run)
      end
    end
  end
end