lib/nats/rpc/servant.rb in nats-rpc-0.0.6 vs lib/nats/rpc/servant.rb in nats-rpc-0.0.7
- old
+ new
@@ -3,10 +3,15 @@
class Servant
def initialize(id: SecureRandom.uuid, **cluster_opts)
@id = id
@nats = NATS::IO::Client.new
- @nats.connect cluster_opts || NATS::RPC.cluster_opts
+
+ @nats.connect(if cluster_opts.keys.size > 0
+ cluster_opts
+ else
+ NATS::RPC.cluster_opts
+ end)
@count_json_parse_errors = 0
@count_block_call_errors = 0
@count_to_json_errors = 0
@count_messages = 0