Class: BPS::Publisher::NATS::Topic

Inherits:
Abstract::Topic
  • Object
show all
Defined in:
lib/bps/publisher/nats.rb

Instance Method Summary collapse

Constructor Details

#initialize(client, topic) ⇒ Topic

Returns a new instance of Topic.



10
11
12
13
14
15
# File 'lib/bps/publisher/nats.rb', line 10

def initialize(client, topic)
  super()

  @client = client
  @topic = topic
end

Instance Method Details

#flushObject



21
22
23
# File 'lib/bps/publisher/nats.rb', line 21

def flush(**)
  @client.flush(FLUSH_TIMEOUT)
end

#publish(message, **_opts) ⇒ Object



17
18
19
# File 'lib/bps/publisher/nats.rb', line 17

def publish(message, **_opts)
  @client.publish(@topic, message)
end