nsq-ruby 0.2.0 → 1.0.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: 16ea2d920538289564a71a48e051589bd8977a53
4
- data.tar.gz: 4ac36aa2fcf6178267d75f46db965555756337bc
3
+ metadata.gz: ff501ee79a72dddfe0ad95cb66546d9c76ba2cc1
4
+ data.tar.gz: 6846d94a38a28d8e2a431d955743e6b2b93c4bab
5
5
  SHA512:
6
- metadata.gz: 6d528a2b2b3752cc9ded663ea4bcc1f8343bb6300481cbeb9587b4e543acccda9a469e8463a1060f951937accb751dfb0e214b6aab86de8d25f5f8b3bd5301b3
7
- data.tar.gz: 73f9c978d51d10b3e2a7a61092cf96c1e7d1d5b1c4899f943c0a2a331e35f94c741a1f765831d8bd718b534c7983a71a556851a8bf1bcebb9406fb65dee34563
6
+ metadata.gz: 7366335b514e4370be9a1d09415f5cdab9256905f7ec04191d81b7e95e1cea49e018e0abf44fa05918d35f52615157284f16dc206a36c5dca75d034ee47e5522
7
+ data.tar.gz: 79db1e4772c1e50e3be6c477d634dc21b6af712c4f61c90caee56bed7acb5b615922670f7998f629dd242064f8af88728b5ca8f26e4c0ec1f84ae720d5b977c5
data/README.md CHANGED
@@ -5,6 +5,7 @@ nsq-ruby is a simple NSQ client library written in Ruby.
5
5
  - The code is straightforward.
6
6
  - It has no dependencies.
7
7
  - It's well tested.
8
+ - It's being used in production and has processed billions of messages.
8
9
 
9
10
 
10
11
  ## Quick start
@@ -199,6 +200,10 @@ most messages this should be 1 (since it will be your first attempt processing
199
200
  them). If it's more than 1, that means that you requeued the message or it
200
201
  timed out in flight.
201
202
 
203
+ ### `timestamp`
204
+
205
+ Returns the time this message was originally sent to NSQ as a `Time` object.
206
+
202
207
  ### `#finish`
203
208
 
204
209
  Notify NSQ that you've completed processing of this message.
@@ -237,6 +242,7 @@ connection timeout support (0.2.29).
237
242
 
238
243
  - Discovery via nsqlookupd
239
244
  - Automatic reconnection to nsqd
245
+ - Producing to all nsqd instances automatically via nsqlookupd
240
246
 
241
247
  ### Does not support
242
248
 
@@ -266,6 +272,13 @@ VERBOSE=true rake spec
266
272
  ```
267
273
 
268
274
 
275
+ ## Is this production ready?
276
+
277
+ Yes! It's used in several critical parts of our infrastructure at
278
+ [Wistia](http://wistia.com) and currently produces and consumes tens of
279
+ millions of messages a day.
280
+
281
+
269
282
  ## Authors
270
283
 
271
284
  - Robby Grossman (@freerobby)
@@ -3,14 +3,13 @@ require_relative 'frame'
3
3
  module Nsq
4
4
  class Message < Frame
5
5
 
6
- attr_reader :timestamp
7
6
  attr_reader :attempts
8
7
  attr_reader :id
9
8
  attr_reader :body
10
9
 
11
10
  def initialize(data, connection)
12
11
  super
13
- @timestamp, @attempts, @id, @body = @data.unpack('Q>s>a16a*')
12
+ @timestamp_in_nanoseconds, @attempts, @id, @body = @data.unpack('Q>s>a16a*')
14
13
  @body.force_encoding('UTF-8')
15
14
  end
16
15
 
@@ -26,5 +25,9 @@ module Nsq
26
25
  connection.touch(id)
27
26
  end
28
27
 
28
+ def timestamp
29
+ Time.at(@timestamp_in_nanoseconds / 1_000_000_000.0)
30
+ end
31
+
29
32
  end
30
33
  end
data/lib/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Nsq
2
2
  module Version
3
- MAJOR = 0
4
- MINOR = 2
3
+ MAJOR = 1
4
+ MINOR = 0
5
5
  PATCH = 0
6
6
  BUILD = nil
7
7
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nsq-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.0.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-08-19 00:00:00.000000000 Z
11
+ date: 2014-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -30,42 +30,42 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.0.1
33
+ version: '2.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 2.0.1
40
+ version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: nsq-cluster
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.1.0
47
+ version: '1.1'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.1.0
54
+ version: '1.1'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 3.0.0
61
+ version: '3.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 3.0.0
68
+ version: '3.0'
69
69
  description: ''
70
70
  email: dev@wistia.com
71
71
  executables: []