Class: Polyn::Nats
- Inherits:
-
Object
- Object
- Polyn::Nats
- Defined in:
- lib/polyn/nats.rb,
lib/polyn/nats/msg.rb
Overview
Adapter/wrapper around Nats
Defined Under Namespace
Classes: Msg
Instance Attribute Summary collapse
-
#nats ⇒ Object
readonly
Returns the value of attribute nats.
Instance Method Summary collapse
-
#initialize(nats) ⇒ Nats
constructor
A new instance of Nats.
- #jetstream ⇒ Object
- #publish(type, json, reply, **opts) ⇒ Object
- #subscribe(type, opts = {}, &callback) ⇒ Object
Constructor Details
#initialize(nats) ⇒ Nats
Returns a new instance of Nats.
7 8 9 |
# File 'lib/polyn/nats.rb', line 7 def initialize(nats) @nats = nats end |
Instance Attribute Details
#nats ⇒ Object (readonly)
Returns the value of attribute nats.
11 12 13 |
# File 'lib/polyn/nats.rb', line 11 def nats @nats end |
Instance Method Details
#jetstream ⇒ Object
21 22 23 |
# File 'lib/polyn/nats.rb', line 21 def jetstream @jetstream ||= @nats.jetstream end |
#publish(type, json, reply, **opts) ⇒ Object
13 14 15 |
# File 'lib/polyn/nats.rb', line 13 def publish(type, json, reply, **opts) @nats.publish(type, json, reply, **opts) end |