Method: STAN::Client#initialize

Defined in:
lib/stan/client.rb

#initializeClient

Returns a new instance of Client.



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/stan/client.rb', line 51

def initialize
  super

  # Connection to NATS, either owned or borrowed
  @nats = nil
  @borrowed_nats_connection = false

  # STAN subscriptions map
  @sub_map = {}

  # Publish Ack map (guid => ack)
  @pub_ack_map = {}
  @pending_pub_acks = nil

  # Cluster to which we are connecting
  @cluster_id = nil
  @client_id = nil

  # Connect options
  @options = {}

  # NATS Streaming subjects

  # Inbox subscription for periodical heartbeat messages
  @hb_inbox = nil
  @hb_inbox_sid = nil

  # Subscription for processing received acks from the server
  @ack_subject = nil
  @ack_subject_sid = nil

  # Publish prefix set by stan to which we append our subject on publish.
  @pub_prefix        = nil
  @sub_req_subject   = nil
  @unsub_req_subject = nil
  @close_req_subject = nil
  @sub_close_req_subject = nil

  # For initial connect request to discover subjects used by
  # the streaming server.
  @discover_subject = nil
end