Class: Que::Adapters::PG
Instance Attribute Summary collapse
-
#lock ⇒ Object
readonly
Returns the value of attribute lock.
Instance Method Summary collapse
- #checkout ⇒ Object
-
#initialize(pg) ⇒ PG
constructor
A new instance of PG.
Methods inherited from Base
#cleanup!, #execute, #in_transaction?, #wake_worker_after_commit
Constructor Details
#initialize(pg) ⇒ PG
Returns a new instance of PG.
10 11 12 13 14 |
# File 'lib/que/adapters/pg.rb', line 10 def initialize(pg) @pg = pg @lock = Monitor.new # Must be re-entrant. super end |
Instance Attribute Details
#lock ⇒ Object (readonly)
Returns the value of attribute lock.
8 9 10 |
# File 'lib/que/adapters/pg.rb', line 8 def lock @lock end |
Instance Method Details
#checkout ⇒ Object
16 17 18 |
# File 'lib/que/adapters/pg.rb', line 16 def checkout @lock.synchronize { yield @pg } end |