class Rufus::Scheduler

def lock


Look at rufus/scheduler/locks.rb for an example.

and #unlock, and both of these methods should be idempotent.
to #lock
accepts :scheduler_lock => lock_object. lock_object only needs to respond
If one needs to use a special/different locking mechanism, the scheduler

so it probably won't work reliably on distributed file systems.
run (the first to write the lockfile and lock it). It uses "man 2 flock"
it easy for schedulers on the same machine to determine which should
:lockfile => 'path/to/lock/file' scheduler start option. It makes
Out of the box, rufus-scheduler proposes the

not run, the method should return false.
only one of them should run the scheduler. For schedulers that should
return true. It is useful in cases where among a group of applications
Most of the time, a scheduler is run alone and this method should

thus may run.
Returns true if the scheduler has acquired the [exclusive] lock and
def lock
  @scheduler_lock.lock
end