iron_mq 3.1.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile.lock +10 -8
- data/README.md +278 -53
- data/iron_mq.gemspec +3 -2
- data/lib/iron_mq/client.rb +32 -9
- data/lib/iron_mq/messages.rb +21 -104
- data/lib/iron_mq/queues.rb +149 -142
- data/lib/iron_mq/response.rb +16 -15
- data/lib/iron_mq/subscribers.rb +12 -21
- data/lib/iron_mq/version.rb +1 -1
- data/test/quick_run.rb +69 -39
- data/test/test_base.rb +13 -5
- data/test/test_beanstalkd.rb +26 -4
- data/test/test_bulk.rb +7 -3
- data/test/test_iron_mq.rb +370 -159
- data/test/test_push_queues.rb +21 -7
- metadata +41 -45
data/test/test_push_queues.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Put config.yml file in ~/Dropbox/configs/ironmq_gem/test/config.yml
|
2
|
-
require 'test_base'
|
2
|
+
require File.expand_path('test_base.rb', File.dirname(__FILE__))
|
3
3
|
require 'logger'
|
4
4
|
|
5
5
|
class TestPushQueues < TestBase
|
@@ -18,11 +18,14 @@ class TestPushQueues < TestBase
|
|
18
18
|
def test_queue_subscriptions
|
19
19
|
omit_if @skip
|
20
20
|
types = ["multicast", "unicast"]
|
21
|
+
# to delete queues later (clear project)
|
22
|
+
queue_names = []
|
21
23
|
types.each do |t|
|
22
24
|
|
23
25
|
LOG.info "Trying type #{t}"
|
24
26
|
|
25
27
|
qname = "subscription-queue-#{t}"
|
28
|
+
queue_names << qname
|
26
29
|
|
27
30
|
num_subscribers = 10
|
28
31
|
subscribers = []
|
@@ -36,8 +39,7 @@ class TestPushQueues < TestBase
|
|
36
39
|
queue = @client.queue(qname)
|
37
40
|
res = queue.update_queue(:subscribers => subscribers,
|
38
41
|
:push_type => t)
|
39
|
-
|
40
|
-
LOG.debug queue
|
42
|
+
|
41
43
|
LOG.debug queue.subscribers
|
42
44
|
assert_equal num_subscribers, queue.subscribers.size
|
43
45
|
|
@@ -115,6 +117,7 @@ class TestPushQueues < TestBase
|
|
115
117
|
# (default retries_delay is 60s).
|
116
118
|
sleep 1
|
117
119
|
tries -= 1
|
120
|
+
# old style of message getting
|
118
121
|
msg = queue.messages.get(m.id)
|
119
122
|
LOG.info "checking for message: #{msg}"
|
120
123
|
next if msg.nil?
|
@@ -141,6 +144,10 @@ class TestPushQueues < TestBase
|
|
141
144
|
break
|
142
145
|
end
|
143
146
|
assert_not_equal tries, 0
|
147
|
+
|
148
|
+
# delete queue after all tests on it were completed
|
149
|
+
resp = queue.delete_queue
|
150
|
+
assert_equal 200, resp.code, "API must response with HTTP 200 status, but returned HTTP #{resp.code}"
|
144
151
|
end
|
145
152
|
end
|
146
153
|
|
@@ -218,6 +225,10 @@ class TestPushQueues < TestBase
|
|
218
225
|
break
|
219
226
|
end
|
220
227
|
assert_not_equal tries, 0
|
228
|
+
|
229
|
+
# delete queue on test complete
|
230
|
+
resp = queue.delete_queue
|
231
|
+
assert_equal 200, resp.code, "API must response with HTTP 200 status, but returned HTTP #{resp.code}"
|
221
232
|
end
|
222
233
|
|
223
234
|
|
@@ -242,15 +253,14 @@ class TestPushQueues < TestBase
|
|
242
253
|
queue = @client.queue(qname)
|
243
254
|
res = queue.update_queue(:subscribers => subscribers,
|
244
255
|
:push_type => t)
|
245
|
-
|
256
|
+
|
246
257
|
LOG.debug queue
|
247
|
-
|
258
|
+
|
248
259
|
assert_equal num_subscribers, queue.subscribers.size
|
249
260
|
# todo: assert subscriptions match
|
250
261
|
|
251
262
|
msg = "hello #{x}"
|
252
|
-
m = queue.post(msg,
|
253
|
-
{:timeout => 2})
|
263
|
+
m = queue.post(msg, {:timeout => 2})
|
254
264
|
|
255
265
|
tries = MAX_TRIES
|
256
266
|
while tries > 0
|
@@ -322,6 +332,10 @@ class TestPushQueues < TestBase
|
|
322
332
|
break
|
323
333
|
end
|
324
334
|
assert_not_equal 0, tries
|
335
|
+
|
336
|
+
# delete queue on test complete
|
337
|
+
resp = queue.delete_queue
|
338
|
+
assert_equal 200, resp.code, "API must response with HTTP 200 status, but returned HTTP #{resp.code}"
|
325
339
|
end
|
326
340
|
end
|
327
341
|
|
metadata
CHANGED
@@ -1,162 +1,159 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iron_mq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
5
|
-
prerelease:
|
4
|
+
version: 4.0.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
7
|
+
- Yury Yantsevich
|
8
8
|
- Travis Reeder
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-03-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: iron_core
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
17
|
requirements:
|
19
|
-
- -
|
18
|
+
- - '>='
|
20
19
|
- !ruby/object:Gem::Version
|
21
20
|
version: 0.5.1
|
22
21
|
type: :runtime
|
23
22
|
prerelease: false
|
24
23
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
24
|
requirements:
|
27
|
-
- -
|
25
|
+
- - '>='
|
28
26
|
- !ruby/object:Gem::Version
|
29
27
|
version: 0.5.1
|
30
28
|
- !ruby/object:Gem::Dependency
|
31
29
|
name: test-unit
|
32
30
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
31
|
requirements:
|
35
|
-
- -
|
32
|
+
- - '>='
|
36
33
|
- !ruby/object:Gem::Version
|
37
34
|
version: '0'
|
38
35
|
type: :development
|
39
36
|
prerelease: false
|
40
37
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
38
|
requirements:
|
43
|
-
- -
|
39
|
+
- - '>='
|
44
40
|
- !ruby/object:Gem::Version
|
45
41
|
version: '0'
|
46
42
|
- !ruby/object:Gem::Dependency
|
47
43
|
name: minitest
|
48
44
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
45
|
requirements:
|
51
|
-
- -
|
46
|
+
- - '>='
|
52
47
|
- !ruby/object:Gem::Version
|
53
48
|
version: '0'
|
54
49
|
type: :development
|
55
50
|
prerelease: false
|
56
51
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
52
|
requirements:
|
59
|
-
- -
|
53
|
+
- - '>='
|
60
54
|
- !ruby/object:Gem::Version
|
61
55
|
version: '0'
|
62
56
|
- !ruby/object:Gem::Dependency
|
63
57
|
name: rake
|
64
58
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
59
|
requirements:
|
67
|
-
- -
|
60
|
+
- - '>='
|
68
61
|
- !ruby/object:Gem::Version
|
69
62
|
version: '0'
|
70
63
|
type: :development
|
71
64
|
prerelease: false
|
72
65
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
66
|
requirements:
|
75
|
-
- -
|
67
|
+
- - '>='
|
76
68
|
- !ruby/object:Gem::Version
|
77
69
|
version: '0'
|
78
70
|
- !ruby/object:Gem::Dependency
|
79
71
|
name: beanstalk-client
|
80
72
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
73
|
requirements:
|
83
|
-
- -
|
74
|
+
- - '>='
|
84
75
|
- !ruby/object:Gem::Version
|
85
76
|
version: '0'
|
86
77
|
type: :development
|
87
78
|
prerelease: false
|
88
79
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
80
|
requirements:
|
91
|
-
- -
|
81
|
+
- - '>='
|
92
82
|
- !ruby/object:Gem::Version
|
93
83
|
version: '0'
|
94
84
|
- !ruby/object:Gem::Dependency
|
95
85
|
name: uber_config
|
96
86
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
87
|
requirements:
|
99
|
-
- -
|
88
|
+
- - '>='
|
100
89
|
- !ruby/object:Gem::Version
|
101
90
|
version: '0'
|
102
91
|
type: :development
|
103
92
|
prerelease: false
|
104
93
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
94
|
requirements:
|
107
|
-
- -
|
95
|
+
- - '>='
|
108
96
|
- !ruby/object:Gem::Version
|
109
97
|
version: '0'
|
110
98
|
- !ruby/object:Gem::Dependency
|
111
99
|
name: typhoeus
|
112
100
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
101
|
requirements:
|
115
|
-
- -
|
102
|
+
- - '>='
|
116
103
|
- !ruby/object:Gem::Version
|
117
104
|
version: 0.5.4
|
118
105
|
type: :development
|
119
106
|
prerelease: false
|
120
107
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
108
|
requirements:
|
123
|
-
- -
|
109
|
+
- - '>='
|
124
110
|
- !ruby/object:Gem::Version
|
125
111
|
version: 0.5.4
|
126
112
|
- !ruby/object:Gem::Dependency
|
127
113
|
name: concur
|
128
114
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
115
|
requirements:
|
131
|
-
- -
|
116
|
+
- - '>='
|
132
117
|
- !ruby/object:Gem::Version
|
133
118
|
version: '0'
|
134
119
|
type: :development
|
135
120
|
prerelease: false
|
136
121
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
122
|
requirements:
|
139
|
-
- -
|
123
|
+
- - '>='
|
140
124
|
- !ruby/object:Gem::Version
|
141
125
|
version: '0'
|
142
126
|
- !ruby/object:Gem::Dependency
|
143
127
|
name: net-http-persistent
|
144
128
|
requirement: !ruby/object:Gem::Requirement
|
145
|
-
none: false
|
146
129
|
requirements:
|
147
|
-
- -
|
130
|
+
- - '>='
|
148
131
|
- !ruby/object:Gem::Version
|
149
132
|
version: '0'
|
150
133
|
type: :development
|
151
134
|
prerelease: false
|
152
135
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
136
|
requirements:
|
155
|
-
- -
|
137
|
+
- - '>='
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
140
|
+
- !ruby/object:Gem::Dependency
|
141
|
+
name: quicky
|
142
|
+
requirement: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - '>='
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: '0'
|
147
|
+
type: :development
|
148
|
+
prerelease: false
|
149
|
+
version_requirements: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - '>='
|
156
152
|
- !ruby/object:Gem::Version
|
157
153
|
version: '0'
|
158
154
|
description: Ruby client for IronMQ by www.iron.io
|
159
155
|
email:
|
156
|
+
- yury@iron.io
|
160
157
|
- travis@iron.io
|
161
158
|
executables: []
|
162
159
|
extensions: []
|
@@ -186,27 +183,26 @@ files:
|
|
186
183
|
- test/test_push_queues.rb
|
187
184
|
homepage: https://github.com/iron-io/iron_mq_ruby
|
188
185
|
licenses: []
|
186
|
+
metadata: {}
|
189
187
|
post_install_message:
|
190
188
|
rdoc_options: []
|
191
189
|
require_paths:
|
192
190
|
- lib
|
193
191
|
required_ruby_version: !ruby/object:Gem::Requirement
|
194
|
-
none: false
|
195
192
|
requirements:
|
196
|
-
- -
|
193
|
+
- - '>='
|
197
194
|
- !ruby/object:Gem::Version
|
198
195
|
version: '1.8'
|
199
196
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
200
|
-
none: false
|
201
197
|
requirements:
|
202
|
-
- -
|
198
|
+
- - '>='
|
203
199
|
- !ruby/object:Gem::Version
|
204
200
|
version: 1.3.6
|
205
201
|
requirements: []
|
206
202
|
rubyforge_project:
|
207
|
-
rubygems_version:
|
203
|
+
rubygems_version: 2.0.0
|
208
204
|
signing_key:
|
209
|
-
specification_version:
|
205
|
+
specification_version: 4
|
210
206
|
summary: Ruby client for IronMQ by www.iron.io
|
211
207
|
test_files:
|
212
208
|
- test/long_run.rb
|