nsq-cluster 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 912e82c06fc1606ed7a0c6cfcef965b7c150db75
4
- data.tar.gz: 73cbfdcfa92085899ade4fd397a3d12c4477d043
3
+ metadata.gz: b6b7eaacf056401979d86350a7fe6671ac938e69
4
+ data.tar.gz: 8ef918b8ead29882028f73f38fbf746bdddb306c
5
5
  SHA512:
6
- metadata.gz: 63c76b46b7f9d20c8e75e018f8514f5d5f713ea4d0467123a9c0cfa33ae76eaeb777d2529b5ea0fb59275c440fa323cc7c1c672fe80616804f8604731f5ae870
7
- data.tar.gz: 9802793529d7d68b1814204e2d31213ba25c6a473e64a897e36d08aba79318960d1efeac63fb3c9dba8b9e234765ecaa50606db52548fffe987f5f422466a0fd
6
+ metadata.gz: b75e759f4ac438a3d8dfb02f06a9770eb55422298ac4f399f39496841b194a9d6ef07d4da5e788b95fc8a39b34e4dc6f574e0fa4454891140fcea43784fd05f9
7
+ data.tar.gz: 0195b5c6014f498a8eacdc118e0aebabba95a92ed68b6dc1f72b29cc503baf535b80d5c7e7b89543c38cd58b3bcb2c5ff47da4a51a72e7e59ee3ce94c51f7f8e
data/bin/nsq-cluster CHANGED
@@ -9,7 +9,9 @@ options = {
9
9
  nsqd_count: 1,
10
10
  nsqlookupd_count: 1,
11
11
  nsqadmin: true,
12
- verbose: true
12
+ verbose: true,
13
+ nsqd_options: { base_port: 4150 },
14
+ nsqlookupd_options: { base_port: 4160 }
13
15
  }
14
16
 
15
17
  OptionParser.new do |opts|
@@ -6,7 +6,7 @@ class Nsqd < ProcessWrapper
6
6
  include HTTPWrapper
7
7
 
8
8
 
9
- attr_reader :host, :tcp_port, :http_port, :id
9
+ attr_reader :host, :tcp_port, :http_port, :id, :base_port
10
10
 
11
11
 
12
12
  def initialize(opts = {}, verbose = false)
@@ -14,8 +14,13 @@ class Nsqd < ProcessWrapper
14
14
 
15
15
  @id = opts.delete(:id) || 0
16
16
  @host = opts.delete(:host) || '127.0.0.1'
17
- @tcp_port = opts.delete(:tcp_port) || (4150 + @id * 2)
18
- @http_port = opts.delete(:http_port) || (4151 + @id * 2)
17
+
18
+ # Use a non-standard nsqd port by default so as to not conflict with any
19
+ # local instances. This is helpful when running tests!
20
+ @base_port = opts.delete(:base_port) || 4250
21
+
22
+ @tcp_port = opts.delete(:tcp_port) || (@base_port + @id * 2)
23
+ @http_port = opts.delete(:http_port) || (@base_port + 1 + @id * 2)
19
24
  @lookupd = opts.delete(:nsqlookupd) || []
20
25
  @broadcast_address = opts.delete(:broadcast_address) || @host
21
26
 
@@ -4,15 +4,20 @@ require_relative 'http_wrapper'
4
4
  class Nsqlookupd < ProcessWrapper
5
5
  include HTTPWrapper
6
6
 
7
- attr_reader :host, :tcp_port, :http_port
7
+ attr_reader :host, :tcp_port, :http_port, :base_port
8
8
 
9
9
  def initialize(opts = {}, verbose = false)
10
10
  super
11
11
 
12
12
  @id = opts.delete(:id) || 0
13
13
  @host = opts.delete(:host) || '127.0.0.1'
14
- @tcp_port = opts.delete(:tcp_port) || (4160 + @id * 2)
15
- @http_port = opts.delete(:http_port) || (4161 + @id * 2)
14
+
15
+ # Use a non-standard nsqlookupd port by default so as to not conflict with
16
+ # any local instances. This is helpful when running tests!
17
+ @base_port = opts.delete(:base_port) || 4360
18
+
19
+ @tcp_port = opts.delete(:tcp_port) || (@base_port + @id * 2)
20
+ @http_port = opts.delete(:http_port) || (@base_port + 1 + @id * 2)
16
21
  @broadcast_address = opts.delete(:broadcast_address) || @host
17
22
 
18
23
  @extra_args = opts.map do |key, value|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nsq-cluster
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wistia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-31 00:00:00.000000000 Z
11
+ date: 2014-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sys-proctable