Sha256: 49d1d7e61e33083d8a5af39130c8ea4040dc76c469534797a74277ea2637f3dd
Contents?: true
Size: 665 Bytes
Versions: 51
Compression:
Stored size: 665 Bytes
Contents
# frozen_string_literal: true module Cloudtasker module UniqueJob module Lock # Conflict if any other job with the same args is scheduled # while the first job is pending. class UntilExecuting < BaseLock # # Acquire a lock for the job and trigger a conflict # if the lock could not be acquired. # def schedule job.lock! yield rescue LockError conflict_instance.on_schedule { yield } end # # Release the lock and perform the job. # def execute job.unlock! yield end end end end end
Version data entries
51 entries across 51 versions & 1 rubygems