Class: NatsClient
- Inherits:
-
Object
- Object
- NatsClient
- Defined in:
- lib/tailslide/nats_client.rb
Instance Attribute Summary collapse
-
#callback ⇒ Object
readonly
Returns the value of attribute callback.
-
#connection_string ⇒ Object
readonly
Returns the value of attribute connection_string.
-
#jetstream ⇒ Object
Returns the value of attribute jetstream.
-
#nats_connection ⇒ Object
Returns the value of attribute nats_connection.
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
-
#subscribed_stream ⇒ Object
Returns the value of attribute subscribed_stream.
Instance Method Summary collapse
-
#initialize(server_url: 'localhost:4222', stream: '', subject: '', callback: nil, token: '') ⇒ NatsClient
constructor
A new instance of NatsClient.
- #initialize_flags ⇒ Object
Constructor Details
#initialize(server_url: 'localhost:4222', stream: '', subject: '', callback: nil, token: '') ⇒ NatsClient
Returns a new instance of NatsClient.
10 11 12 13 14 15 |
# File 'lib/tailslide/nats_client.rb', line 10 def initialize(server_url: 'localhost:4222', stream: '', subject: '', callback: nil, token: '') @stream = stream @subject = format_subject(subject) @connection_string = "nats://#{token}#{'@' if token}#{server_url}" @callback = callback end |
Instance Attribute Details
#callback ⇒ Object (readonly)
Returns the value of attribute callback.
8 9 10 |
# File 'lib/tailslide/nats_client.rb', line 8 def callback @callback end |
#connection_string ⇒ Object (readonly)
Returns the value of attribute connection_string.
8 9 10 |
# File 'lib/tailslide/nats_client.rb', line 8 def connection_string @connection_string end |
#jetstream ⇒ Object
Returns the value of attribute jetstream.
7 8 9 |
# File 'lib/tailslide/nats_client.rb', line 7 def jetstream @jetstream end |
#nats_connection ⇒ Object
Returns the value of attribute nats_connection.
7 8 9 |
# File 'lib/tailslide/nats_client.rb', line 7 def nats_connection @nats_connection end |
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
8 9 10 |
# File 'lib/tailslide/nats_client.rb', line 8 def stream @stream end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
8 9 10 |
# File 'lib/tailslide/nats_client.rb', line 8 def subject @subject end |
#subscribed_stream ⇒ Object
Returns the value of attribute subscribed_stream.
7 8 9 |
# File 'lib/tailslide/nats_client.rb', line 7 def subscribed_stream @subscribed_stream end |
Instance Method Details
#initialize_flags ⇒ Object
17 18 19 20 21 |
# File 'lib/tailslide/nats_client.rb', line 17 def initialize_flags connect end |