Class: Sync::EM::PG

Inherits:
EM::PG
  • Object
show all
Defined in:
lib/sync-em/pg.rb,
lib/sync-em/pg/sequel.rb

Direct Known Subclasses

PGconn

Defined Under Namespace

Classes: PGconn, ReConnectionPool, Sequel

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ PG

Returns a new instance of PG.



16
17
18
19
# File 'lib/sync-em/pg.rb', line 16

def initialize(*args)
  super
  PG._sync{ self }
end

Class Method Details

._syncObject



8
9
10
11
12
13
14
# File 'lib/sync-em/pg.rb', line 8

def self._sync
  f = Fiber.current
  resp = yield
  resp.callback{ |r| f.resume(r) }
  resp.errback{ |r| f.resume(r) }
  Fiber.yield
end