Class: Nsqadmin
- Inherits:
-
ProcessWrapper
- Object
- ProcessWrapper
- Nsqadmin
- Defined in:
- lib/nsq-cluster/nsqadmin.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#http_port ⇒ Object
readonly
Returns the value of attribute http_port.
Instance Method Summary collapse
- #args ⇒ Object
- #command ⇒ Object
-
#initialize(opts = {}) ⇒ Nsqadmin
constructor
A new instance of Nsqadmin.
Methods inherited from ProcessWrapper
#destroy, #output, #running?, #start, #stop
Constructor Details
#initialize(opts = {}) ⇒ Nsqadmin
Returns a new instance of Nsqadmin.
7 8 9 10 11 12 13 |
# File 'lib/nsq-cluster/nsqadmin.rb', line 7 def initialize(opts = {}) @host = '127.0.0.1' @http_port = opts[:http_port] || 4171 @lookupd = opts[:nsqlookupd] || [] super end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
5 6 7 |
# File 'lib/nsq-cluster/nsqadmin.rb', line 5 def host @host end |
#http_port ⇒ Object (readonly)
Returns the value of attribute http_port.
5 6 7 |
# File 'lib/nsq-cluster/nsqadmin.rb', line 5 def http_port @http_port end |
Instance Method Details
#args ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/nsq-cluster/nsqadmin.rb', line 21 def args base_args = [ %Q(--http-address=#{@host}:#{@http_port}) ] lookupd_args = @lookupd.map do |ld| %Q(--lookupd-http-address=#{ld.host}:#{ld.http_port}) end base_args + lookupd_args end |
#command ⇒ Object
16 17 18 |
# File 'lib/nsq-cluster/nsqadmin.rb', line 16 def command 'nsqadmin' end |