nsq-ruby-fastly 2.4.0 → 2.4.1

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
  SHA256:
3
- metadata.gz: ba51761d5abfe9acbb63eceac3e053b8323fd31cee0d03e165ad4263c63dc985
4
- data.tar.gz: 26f1770323d24d83bd828cb2f0073472299d41b174177ce4bd351bcf5b876626
3
+ metadata.gz: b4ea6714940846f466b7cced4d36dfc745146a0d274ee4dfd5ae48f90c3320e5
4
+ data.tar.gz: 41342d811da1aee48b4aee5307d31924533ca38306aca76543fe290d3674a55f
5
5
  SHA512:
6
- metadata.gz: fe327495f3c7487d679257c73b020ecbbbc64c91d6c3a36caff79c23bcc171cb4c898d1675b011d717c34c19b3d5f7226f81408b9af09931dac6b90bec85a861
7
- data.tar.gz: 87eb4b1748c1c068b53df2e53befdd31bf2894f906c6273bc5576e99f1febf54f54e174a174ea3f4cefc65e2b4129cee09cd87c37014087afba6f45a4826c92b
6
+ metadata.gz: 9cc45e1559ca14d04a27b4cfc8c5852b2e0b2c56d1f66f4025a0500e1fa94bbfe4a9224e0fe01bd86bcc0698ebc509561da54c963367774532b385c99244ed7e
7
+ data.tar.gz: 6772e90a172bb4acaffb8f569768d5a9f5541888523c89fbd92228ccc42872fcb1ccc53ec4ba408eb9e110fbaabdac24ad97da7ffbad31ef5a79dda1ba57fb1c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.4.0
4
+
5
+ * Use URI.encode_www_form_component instead of URI.escape. (#1)
6
+ * Support specifying multiple nsqd's when creating a consumer. (#2)
7
+
3
8
  ## 2.3.1
4
9
 
5
10
  * Fix `max_attempts` bug (#46)
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # nsq-ruby
2
2
 
3
+ **This is a fork of [wistia/nsq-ruby](https://github.com/wistia/nsq-ruby).**
4
+
3
5
  nsq-ruby is a simple NSQ client library written in Ruby.
4
6
 
5
7
  - The code is straightforward.
@@ -7,8 +9,15 @@ nsq-ruby is a simple NSQ client library written in Ruby.
7
9
  - It's well tested.
8
10
  - It's being used in production and has processed billions of messages.
9
11
 
10
- [![Build Status](https://travis-ci.org/wistia/nsq-ruby.svg?branch=master)](https://travis-ci.org/wistia/nsq-ruby)
12
+ [![Build Status](https://travis-ci.com/fastly/nsq-ruby.svg?branch=main)](https://travis-ci.com/fastly/nsq-ruby)
13
+
14
+ ## Gem installation
15
+
16
+ Gemfile:
11
17
 
18
+ ```
19
+ gem 'nsq-ruby-fastly', require: 'nsq-ruby'
20
+ ```
12
21
 
13
22
  ## Quick start
14
23
 
data/lib/nsq/consumer.rb CHANGED
@@ -36,10 +36,14 @@ module Nsq
36
36
  topic: @topic,
37
37
  interval: @discovery_interval
38
38
  )
39
+
40
+ elsif opts[:nsqd]
41
+ nsqds = [opts[:nsqd]].flatten
42
+ max_per_conn = max_in_flight_per_connection(nsqds.size)
43
+ nsqds.each{|d| add_connection(d, max_in_flight: max_per_conn)}
44
+
39
45
  else
40
- # normally, we find nsqd instances to connect to via nsqlookupd(s)
41
- # in this case let's connect to an nsqd instance directly
42
- add_connection(opts[:nsqd] || '127.0.0.1:4150', max_in_flight: @max_in_flight)
46
+ add_connection('127.0.0.1:4150', max_in_flight: @max_in_flight)
43
47
  end
44
48
  end
45
49
 
data/lib/nsq/discovery.rb CHANGED
@@ -70,7 +70,7 @@ module Nsq
70
70
  uri.query = "ts=#{Time.now.to_i}"
71
71
  if topic
72
72
  uri.path = '/lookup'
73
- uri.query += "&topic=#{URI.escape(topic)}"
73
+ uri.query += "&topic=#{URI.encode_www_form_component(topic)}"
74
74
  else
75
75
  uri.path = '/nodes'
76
76
  end
data/lib/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Nsq
2
2
  module Version
3
3
  MAJOR = 2
4
- MINOR = 3
4
+ MINOR = 4
5
5
  PATCH = 1
6
6
  BUILD = nil
7
7
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nsq-ruby-fastly
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wistia, Fastly