Sha256: 8b041803ee0d2e2dfbe53f89ea7a906e1bb0f02d09faf631fd130293dada3a36

Contents?: true

Size: 453 Bytes

Versions: 17

Compression:

Stored size: 453 Bytes

Contents

module CanvasSync::JobUniqueness
  module Strategy
    class UntilExecuting < Base
      locks_on :enqueue

      def on_enqueue
        lock!(:enqueue)
        yield
      end

      def on_perform
        unlock
        yield
      end

      # TODO Define behavior when an error occurs during perform().
      # SUJ's behavior is to relock, but this has some edge-cases (like how do we handle if another job already took the lock?)
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
canvas_sync-0.22.9 lib/canvas_sync/job_uniqueness/strategy/until_executing.rb
canvas_sync-0.22.8 lib/canvas_sync/job_uniqueness/strategy/until_executing.rb
canvas_sync-0.22.6 lib/canvas_sync/job_uniqueness/strategy/until_executing.rb
canvas_sync-0.22.5 lib/canvas_sync/job_uniqueness/strategy/until_executing.rb
canvas_sync-0.22.4 lib/canvas_sync/job_uniqueness/strategy/until_executing.rb
canvas_sync-0.22.3 lib/canvas_sync/job_uniqueness/strategy/until_executing.rb
canvas_sync-0.22.2 lib/canvas_sync/job_uniqueness/strategy/until_executing.rb
canvas_sync-0.22.1 lib/canvas_sync/job_uniqueness/strategy/until_executing.rb
canvas_sync-0.22.0 lib/canvas_sync/job_uniqueness/strategy/until_executing.rb
canvas_sync-0.22.0.beta8 lib/canvas_sync/job_uniqueness/strategy/until_executing.rb
canvas_sync-0.22.0.beta7 lib/canvas_sync/job_uniqueness/strategy/until_executing.rb
canvas_sync-0.22.0.beta6 lib/canvas_sync/job_uniqueness/strategy/until_executing.rb
canvas_sync-0.22.0.beta5 lib/canvas_sync/job_uniqueness/strategy/until_executing.rb
canvas_sync-0.22.0.beta4 lib/canvas_sync/job_uniqueness/strategy/until_executing.rb
canvas_sync-0.22.0.beta3 lib/canvas_sync/job_uniqueness/strategy/until_executing.rb
canvas_sync-0.22.0.beta2 lib/canvas_sync/job_uniqueness/strategy/until_executing.rb
canvas_sync-0.22.0.beta1 lib/canvas_sync/job_uniqueness/strategy/until_executing.rb