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
#execute, #in_transaction?, #wake_worker_after_commit
Constructor Details
#initialize(pg) ⇒ PG
Returns a new instance of PG.
8 9 10 11 12 |
# File 'lib/que/adapters/pg.rb', line 8 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.
6 7 8 |
# File 'lib/que/adapters/pg.rb', line 6 def lock @lock end |
Instance Method Details
#checkout ⇒ Object
14 15 16 |
# File 'lib/que/adapters/pg.rb', line 14 def checkout @lock.synchronize { yield @pg } end |