Module: Meerkat::Backend::PG::SubscribeClient

Defined in:
lib/meerkat/backend/pg.rb

Instance Method Summary collapse

Instance Method Details

#initialize(pg, cb) ⇒ Object



72
73
74
75
76
# File 'lib/meerkat/backend/pg.rb', line 72

def initialize(pg, cb)
  @pg = pg
  @cb = cb
  @last_check = Time.now
end

#notify_readableObject



78
79
80
81
# File 'lib/meerkat/backend/pg.rb', line 78

def notify_readable
  @pg.consume_input
  @cb.call if @pg.notifies
end

#unbindObject



83
84
85
# File 'lib/meerkat/backend/pg.rb', line 83

def unbind
  @pg.close
end