Class: Procrastinate::Runtime

Inherits:
Object
  • Object
show all
Defined in:
lib/procrastinate/runtime.rb

Overview

An instance of this class obtained from the scheduler can be used to perform synchronisation and other communication with the scheduler.

Instance Method Summary collapse

Instance Method Details

#lock(name) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/procrastinate/runtime.rb', line 6

def lock(name)
  lock = Procrastinate::Lock.new(name)
  
  lock.synchronize do
    yield
  end
end