Class: BPS::Subscriber::Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/bps/subscriber/abstract.rb

Instance Method Summary collapse

Constructor Details

#initializeAbstract

Returns a new instance of Abstract.


4
5
6
7
# File 'lib/bps/subscriber/abstract.rb', line 4

def initialize
  @uuid = SecureRandom.uuid
  ObjectSpace.define_finalizer(@uuid, proc { close })
end

Instance Method Details

#closeObject

Close the subscriber.


16
17
18
# File 'lib/bps/subscriber/abstract.rb', line 16

def close
  ObjectSpace.undefine_finalizer(@uuid)
end

#subscribe(_topic) ⇒ Object

Subscribe to a topic


11
12
13
# File 'lib/bps/subscriber/abstract.rb', line 11

def subscribe(_topic, **)
  raise 'not implemented'
end