gearman-ruby 2.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +5 -6
- data/VERSION.yml +2 -2
- data/examples/calculus_client.rb +8 -10
- data/examples/calculus_worker.rb +4 -1
- data/examples/client.php +23 -0
- data/examples/client.rb +6 -10
- data/examples/client_background.rb +7 -7
- data/examples/client_data.rb +4 -4
- data/examples/client_epoch.rb +23 -0
- data/examples/client_exception.rb +4 -2
- data/examples/client_prefix.rb +4 -2
- data/examples/client_reverse.rb +27 -0
- data/examples/scale_image.rb +4 -3
- data/examples/scale_image_worker.rb +1 -1
- data/examples/worker.rb +2 -4
- data/examples/worker_data.rb +2 -2
- data/examples/worker_exception.rb +1 -1
- data/examples/worker_prefix.rb +1 -1
- data/examples/worker_reverse_string.rb +27 -0
- data/examples/worker_reverse_to_file.rb +18 -0
- data/examples/{evented_worker.rb → worker_signals.rb} +18 -8
- data/lib/gearman.rb +68 -21
- data/lib/gearman/client.rb +137 -65
- data/lib/gearman/server.rb +4 -4
- data/lib/gearman/task.rb +140 -20
- data/lib/gearman/taskset.rb +280 -5
- data/lib/gearman/testlib.rb +95 -0
- data/lib/gearman/util.rb +184 -28
- data/lib/gearman/worker.rb +356 -20
- data/test/client_test.rb +145 -0
- data/test/mock_client_test.rb +629 -0
- data/test/mock_worker_test.rb +321 -0
- data/test/util_test.rb +8 -3
- data/test/worker_test.rb +50 -34
- metadata +41 -41
- data/examples/client_echo.rb +0 -16
- data/examples/evented_client.rb +0 -23
- data/examples/worker_echo.rb +0 -20
- data/examples/worker_echo_pprof.rb +0 -5
- data/gearman-ruby.gemspec +0 -111
- data/lib/gearman/evented/client.rb +0 -99
- data/lib/gearman/evented/reactor.rb +0 -86
- data/lib/gearman/evented/worker.rb +0 -118
- data/lib/gearman/job.rb +0 -38
- data/lib/gearman/protocol.rb +0 -110
- data/test/basic_integration_test.rb +0 -121
- data/test/crash_test.rb +0 -69
- data/test/job_test.rb +0 -30
- data/test/protocol_test.rb +0 -132
- data/test/test_helper.rb +0 -31
@@ -0,0 +1,321 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
$:.unshift('../lib')
|
4
|
+
require 'gearman'
|
5
|
+
require 'gearman/testlib'
|
6
|
+
require 'test/unit'
|
7
|
+
require 'thread'
|
8
|
+
|
9
|
+
Thread.abort_on_exception = true
|
10
|
+
|
11
|
+
class TestWorker < Test::Unit::TestCase
|
12
|
+
def setup
|
13
|
+
@server = FakeJobServer.new(self)
|
14
|
+
@server2 = FakeJobServer.new(self)
|
15
|
+
end
|
16
|
+
|
17
|
+
def teardown
|
18
|
+
@server.stop
|
19
|
+
@server2.stop
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_complete
|
23
|
+
@server = FakeJobServer.new(self)
|
24
|
+
worker = nil
|
25
|
+
sock = nil
|
26
|
+
|
27
|
+
s = TestScript.new
|
28
|
+
w = TestScript.new
|
29
|
+
|
30
|
+
server_thread = Thread.new { s.loop_forever }.run
|
31
|
+
worker_thread = Thread.new { w.loop_forever }.run
|
32
|
+
|
33
|
+
# Create a worker and wait for it to connect to us.
|
34
|
+
w.exec {
|
35
|
+
worker = Gearman::Worker.new(
|
36
|
+
"localhost:#{@server.port}", { :client_id => 'test' })
|
37
|
+
}
|
38
|
+
s.exec { sock = @server.expect_connection }
|
39
|
+
s.wait
|
40
|
+
|
41
|
+
# After it connects, it should send its ID, and it should tell us its
|
42
|
+
# abilities when we report them.
|
43
|
+
s.exec { @server.expect_request(sock, :set_client_id, 'test') }
|
44
|
+
w.exec do
|
45
|
+
worker.add_ability('echo') do |data, job|
|
46
|
+
job.report_status(1, 1);
|
47
|
+
part1, part2 = data.split(//, 2)
|
48
|
+
job.send_data(part1) # send partial data first
|
49
|
+
part2
|
50
|
+
end
|
51
|
+
end
|
52
|
+
s.exec { @server.expect_request(sock, :can_do, 'echo') }
|
53
|
+
|
54
|
+
# It should try to grab a job when we tell it to work.
|
55
|
+
w.exec { worker.work }
|
56
|
+
s.exec { @server.expect_request(sock, :grab_job) }
|
57
|
+
|
58
|
+
# If we tell it there aren't any jobs, it should go to sleep.
|
59
|
+
s.exec { @server.send_response(sock, :no_job) }
|
60
|
+
s.exec { @server.expect_request(sock, :pre_sleep) }
|
61
|
+
|
62
|
+
# When we send it a noop, it should wake up and ask for a job again.
|
63
|
+
s.exec { @server.send_response(sock, :noop) }
|
64
|
+
s.exec { @server.expect_request(sock, :grab_job) }
|
65
|
+
|
66
|
+
# When we give it a job, it should do it.
|
67
|
+
s.exec { @server.send_response(sock, :job_assign, "a\0echo\0foo") }
|
68
|
+
s.exec { @server.expect_request(sock, :work_status, "a\0001\0001") }
|
69
|
+
s.exec { @server.expect_request(sock, :work_data, "a\000f") }
|
70
|
+
s.exec { @server.expect_request(sock, :work_complete, "a\0oo") }
|
71
|
+
|
72
|
+
# Test that functions are unregistered correctly.
|
73
|
+
w.exec { worker.remove_ability('echo') }
|
74
|
+
s.exec { @server.expect_request(sock, :cant_do, 'echo') }
|
75
|
+
s.wait
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_multiple_servers
|
79
|
+
# This is cheesy. We want to know the order that Worker#work will
|
80
|
+
# iterate through the servers, so we make sure that server1 will be the
|
81
|
+
# first one when the names are lexographically sorted.
|
82
|
+
if @server2.port.to_s < @server.port.to_s
|
83
|
+
tmp = @server
|
84
|
+
@server = @server2
|
85
|
+
@server2 = tmp
|
86
|
+
end
|
87
|
+
worker = nil
|
88
|
+
sock1, sock2 = nil
|
89
|
+
|
90
|
+
s1 = TestScript.new
|
91
|
+
s2 = TestScript.new
|
92
|
+
w = TestScript.new
|
93
|
+
|
94
|
+
@server_thread = Thread.new { s1.loop_forever }.run
|
95
|
+
@server2_thread = Thread.new { s2.loop_forever }.run
|
96
|
+
worker_thread = Thread.new { w.loop_forever }.run
|
97
|
+
|
98
|
+
# Create a worker, which should connect to both servers.
|
99
|
+
w.exec {
|
100
|
+
worker = Gearman::Worker.new(
|
101
|
+
nil, { :client_id => 'test', :reconnect_sec => 0.1 }) }
|
102
|
+
w.exec { worker.add_ability('foo') {|d,j| 'bar' } }
|
103
|
+
w.exec {
|
104
|
+
worker.job_servers =
|
105
|
+
[ "localhost:#{@server.port}", "localhost:#{@server2.port}" ]
|
106
|
+
}
|
107
|
+
s1.exec { sock1 = @server.expect_connection }
|
108
|
+
s2.exec { sock2 = @server2.expect_connection }
|
109
|
+
s1.wait
|
110
|
+
s2.wait
|
111
|
+
|
112
|
+
# It should register itself with both.
|
113
|
+
s1.exec { @server.expect_request(sock1, :set_client_id, 'test') }
|
114
|
+
s1.exec { @server.expect_request(sock1, :can_do, 'foo') }
|
115
|
+
s2.exec { @server2.expect_request(sock2, :set_client_id, 'test') }
|
116
|
+
s2.exec { @server2.expect_request(sock2, :can_do, 'foo') }
|
117
|
+
|
118
|
+
# It should try to get a job from both servers and then sleep.
|
119
|
+
w.exec { worker.work }
|
120
|
+
s1.exec { @server.expect_request(sock1, :grab_job) }
|
121
|
+
s1.exec { @server.send_response(sock1, :no_job) }
|
122
|
+
s2.exec { @server2.expect_request(sock2, :grab_job) }
|
123
|
+
s2.exec { @server2.send_response(sock2, :no_job) }
|
124
|
+
s1.exec { @server.expect_request(sock1, :pre_sleep) }
|
125
|
+
s2.exec { @server2.expect_request(sock2, :pre_sleep) }
|
126
|
+
|
127
|
+
# If the second server wakes it up, it should again try to get a job
|
128
|
+
# and then do it.
|
129
|
+
s2.exec { @server2.send_response(sock2, :noop) }
|
130
|
+
s1.exec { @server.expect_request(sock1, :grab_job) }
|
131
|
+
s1.exec { @server.send_response(sock1, :no_job) }
|
132
|
+
s2.exec { @server2.expect_request(sock2, :grab_job) }
|
133
|
+
s2.exec { @server2.send_response(sock2, :job_assign, "a\0foo\0") }
|
134
|
+
s2.exec { @server2.expect_request(sock2, :work_complete, "a\0bar") }
|
135
|
+
|
136
|
+
w.wait
|
137
|
+
s1.wait
|
138
|
+
s2.wait
|
139
|
+
|
140
|
+
# Stop the first job server and make the worker try to reconnect to
|
141
|
+
# both.
|
142
|
+
old_servers = worker.job_servers
|
143
|
+
@server.stop
|
144
|
+
worker.job_servers = []
|
145
|
+
worker.job_servers = old_servers
|
146
|
+
s2.exec { sock2 = @server2.expect_connection }
|
147
|
+
s2.wait
|
148
|
+
|
149
|
+
# It shouldn't have any trouble with the second server. Tell it to go
|
150
|
+
# to work.
|
151
|
+
s2.exec { @server2.expect_request(sock2, :set_client_id, 'test') }
|
152
|
+
s2.exec { @server2.expect_request(sock2, :can_do, 'foo') }
|
153
|
+
w.exec { worker.work }
|
154
|
+
s2.exec { @server2.expect_request(sock2, :grab_job) }
|
155
|
+
s2.exec { @server2.send_response(sock2, :no_job) }
|
156
|
+
s2.exec { @server2.expect_request(sock2, :pre_sleep) }
|
157
|
+
s2.wait
|
158
|
+
|
159
|
+
# Start the first server and wait for the worker to connect to it and
|
160
|
+
# register.
|
161
|
+
@server.start
|
162
|
+
s1.exec { sock1 = @server.expect_connection }
|
163
|
+
s1.wait
|
164
|
+
s1.exec { @server.expect_request(sock1, :set_client_id, 'test') }
|
165
|
+
s1.exec { @server.expect_request(sock1, :can_do, 'foo') }
|
166
|
+
s1.wait
|
167
|
+
|
168
|
+
# Let the second server wake the worker up and then give it a job.
|
169
|
+
s2.exec { @server2.send_response(sock2, :noop) }
|
170
|
+
s1.exec { @server.expect_request(sock1, :grab_job) }
|
171
|
+
s1.exec { @server.send_response(sock1, :no_job) }
|
172
|
+
s2.exec { @server2.expect_request(sock2, :grab_job) }
|
173
|
+
s2.exec { @server2.send_response(sock2, :job_assign, "a\0foo\0") }
|
174
|
+
s2.exec { @server2.expect_request(sock2, :work_complete, "a\0bar") }
|
175
|
+
s1.wait
|
176
|
+
s2.wait
|
177
|
+
w.wait
|
178
|
+
end
|
179
|
+
|
180
|
+
def test_timeout
|
181
|
+
worker = nil
|
182
|
+
sock = nil
|
183
|
+
|
184
|
+
s = TestScript.new
|
185
|
+
w = TestScript.new
|
186
|
+
|
187
|
+
server_thread = Thread.new { s.loop_forever }.run
|
188
|
+
worker_thread = Thread.new { w.loop_forever }.run
|
189
|
+
|
190
|
+
w.exec {
|
191
|
+
worker = Gearman::Worker.new("localhost:#{@server.port}",
|
192
|
+
{ :client_id => 'test',
|
193
|
+
:reconnect_sec => 0.15,
|
194
|
+
:network_timeout_sec => 0.1 })
|
195
|
+
}
|
196
|
+
s.exec { sock = @server.expect_connection }
|
197
|
+
s.wait
|
198
|
+
s.exec { @server.expect_request(sock, :set_client_id, 'test') }
|
199
|
+
|
200
|
+
w.exec { worker.add_ability('foo') {|d,j| 'bar' } }
|
201
|
+
s.exec { @server.expect_request(sock, :can_do, 'foo') }
|
202
|
+
|
203
|
+
# Don't do anything after the client asks for a job.
|
204
|
+
w.exec { worker.work }
|
205
|
+
s.exec { @server.expect_request(sock, :grab_job) }
|
206
|
+
s.exec { sleep 0.16 }
|
207
|
+
s.wait
|
208
|
+
|
209
|
+
# The client should reconnect and ask for a job again.
|
210
|
+
s.exec { sock = @server.expect_connection }
|
211
|
+
s.wait
|
212
|
+
|
213
|
+
s.exec { @server.expect_request(sock, :set_client_id, 'test') }
|
214
|
+
s.exec { @server.expect_request(sock, :can_do, 'foo') }
|
215
|
+
s.exec { @server.expect_request(sock, :grab_job) }
|
216
|
+
s.exec { @server.send_response(sock, :job_assign, "a\0foo\0") }
|
217
|
+
s.exec { @server.expect_request(sock, :work_complete, "a\0bar") }
|
218
|
+
s.wait
|
219
|
+
w.wait
|
220
|
+
end
|
221
|
+
|
222
|
+
def test_exception
|
223
|
+
@server = FakeJobServer.new(self)
|
224
|
+
worker = nil
|
225
|
+
sock = nil
|
226
|
+
|
227
|
+
s = TestScript.new
|
228
|
+
w = TestScript.new
|
229
|
+
|
230
|
+
server_thread = Thread.new { s.loop_forever }.run
|
231
|
+
worker_thread = Thread.new { w.loop_forever }.run
|
232
|
+
|
233
|
+
# Create a worker and wait for it to connect to us.
|
234
|
+
w.exec {
|
235
|
+
worker = Gearman::Worker.new(
|
236
|
+
"localhost:#{@server.port}", { :client_id => 'test' })
|
237
|
+
}
|
238
|
+
s.exec { sock = @server.expect_connection }
|
239
|
+
s.wait
|
240
|
+
|
241
|
+
# After it connects, it should send its ID, and it should tell us its
|
242
|
+
# abilities when we report them.
|
243
|
+
s.exec { @server.expect_request(sock, :set_client_id, 'test') }
|
244
|
+
w.exec { worker.add_ability('echo') {|d,j| raise Exception.new("fooexception") } }
|
245
|
+
s.exec { @server.expect_request(sock, :can_do, 'echo') }
|
246
|
+
|
247
|
+
# It should try to grab a job when we tell it to work.
|
248
|
+
w.exec { worker.work }
|
249
|
+
s.exec { @server.expect_request(sock, :grab_job) }
|
250
|
+
|
251
|
+
# If we tell it there aren't any jobs, it should go to sleep.
|
252
|
+
s.exec { @server.send_response(sock, :no_job) }
|
253
|
+
s.exec { @server.expect_request(sock, :pre_sleep) }
|
254
|
+
|
255
|
+
# When we send it a noop, it should wake up and ask for a job again.
|
256
|
+
s.exec { @server.send_response(sock, :noop) }
|
257
|
+
s.exec { @server.expect_request(sock, :grab_job) }
|
258
|
+
|
259
|
+
# When we give it a job, it should raise an excpetion and notify the server
|
260
|
+
s.exec { @server.send_response(sock, :job_assign, "a\0echo\0foo") }
|
261
|
+
s.exec do
|
262
|
+
@server.expect_request(sock, :work_warning, "a\0fooexception")
|
263
|
+
@server.expect_request(sock, :work_fail, "a")
|
264
|
+
end
|
265
|
+
|
266
|
+
s.wait
|
267
|
+
end
|
268
|
+
|
269
|
+
def test_worker_enabled
|
270
|
+
@server = FakeJobServer.new(self)
|
271
|
+
worker = nil
|
272
|
+
sock = nil
|
273
|
+
@result = nil
|
274
|
+
|
275
|
+
s = TestScript.new
|
276
|
+
w = TestScript.new
|
277
|
+
|
278
|
+
server_thread = Thread.new { s.loop_forever }.run
|
279
|
+
worker_thread = Thread.new { w.loop_forever }.run
|
280
|
+
|
281
|
+
# Create a worker and wait for it to connect to us.
|
282
|
+
w.exec {
|
283
|
+
worker = Gearman::Worker.new(
|
284
|
+
"localhost:#{@server.port}", { :client_id => 'test' })
|
285
|
+
}
|
286
|
+
s.exec { sock = @server.expect_connection }
|
287
|
+
s.wait
|
288
|
+
|
289
|
+
# After it connects, it should send its ID, and it should tell us its
|
290
|
+
# abilities when we report them.
|
291
|
+
s.exec { @server.expect_request(sock, :set_client_id, 'test') }
|
292
|
+
w.exec do
|
293
|
+
worker.add_ability('echo') do |data, job|
|
294
|
+
job.report_status(1, 1);
|
295
|
+
part1, part2 = data.split(//, 2)
|
296
|
+
job.send_data(part1) # send partial data first
|
297
|
+
part2
|
298
|
+
end
|
299
|
+
end
|
300
|
+
s.exec { @server.expect_request(sock, :can_do, 'echo') }
|
301
|
+
|
302
|
+
# When we set to false worker_enabled, worker.work shall return false
|
303
|
+
s.exec { @server.send_response(sock, :job_assign, "a\0echo\0foo") }
|
304
|
+
w.exec { worker.worker_enabled = false; @result = worker.work }
|
305
|
+
w.wait
|
306
|
+
assert_equal false, @result
|
307
|
+
|
308
|
+
# When we set to true worker_enabled, worker.work shall return true
|
309
|
+
s.exec { @server.send_response(sock, :job_assign, "a\0echo\0foo") }
|
310
|
+
w.exec { worker.worker_enabled = true; @result = worker.work }
|
311
|
+
w.wait
|
312
|
+
assert_equal true, @result
|
313
|
+
|
314
|
+
# when there are no jobs pending, and set to false worker_enabled, worker.work shall return false
|
315
|
+
s.exec { @server.send_response(sock, :no_job) }
|
316
|
+
w.exec { worker.worker_enabled = false; @result = worker.work }
|
317
|
+
w.wait
|
318
|
+
assert_equal false, @result
|
319
|
+
end
|
320
|
+
|
321
|
+
end
|
data/test/util_test.rb
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
-
|
1
|
+
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
3
|
+
$:.unshift('../lib')
|
4
|
+
require 'gearman'
|
5
|
+
require 'gearman/testlib'
|
6
|
+
require 'test/unit'
|
7
|
+
|
8
|
+
class TestUtil < Test::Unit::TestCase
|
4
9
|
|
5
10
|
def test_ability_prefix_name_builder
|
6
11
|
assert_equal(Gearman::Util.ability_name_with_prefix("test","a"),"test\ta")
|
@@ -8,5 +13,5 @@ class UtilTest < Test::Unit::TestCase
|
|
8
13
|
|
9
14
|
def test_ability_name_for_perl
|
10
15
|
assert_equal(Gearman::Util.ability_name_for_perl("test","a"),"test\ta")
|
11
|
-
end
|
16
|
+
end
|
12
17
|
end
|
data/test/worker_test.rb
CHANGED
@@ -1,45 +1,61 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'rubygems'
|
3
|
+
require 'mocha'
|
4
|
+
|
5
|
+
$:.unshift('../lib')
|
6
|
+
require 'gearman'
|
7
|
+
require 'gearman/testlib'
|
8
|
+
require 'test/unit'
|
9
|
+
|
10
|
+
class TestClient < Test::Unit::TestCase
|
11
|
+
##
|
12
|
+
# Test Gearman::Worker::Ability.
|
13
|
+
def test_ability
|
14
|
+
data, job = nil
|
15
|
+
ability = Gearman::Worker::Ability.new(
|
16
|
+
Proc.new {|d, j| data = d; job = j; true }, 5)
|
17
|
+
assert_equal(5, ability.timeout)
|
18
|
+
assert_equal(true, ability.run(1, 2))
|
19
|
+
assert_equal(1, data)
|
20
|
+
assert_equal(2, job)
|
12
21
|
end
|
13
22
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
23
|
+
##
|
24
|
+
# Test Gearman::Worker::Job.
|
25
|
+
def test_job
|
26
|
+
server = FakeJobServer.new(self)
|
27
|
+
Thread.new do
|
28
|
+
sock = TCPSocket.new('localhost', server.port)
|
29
|
+
job = Gearman::Worker::Job.new(sock, 'handle')
|
30
|
+
job.report_status(10, 20)
|
31
|
+
end.run
|
32
|
+
sock = server.expect_connection
|
33
|
+
server.expect_request(sock, :work_status, "handle\00010\00020")
|
21
34
|
end
|
22
35
|
|
23
|
-
def test_passes_abilities_to_reactor
|
24
|
-
worker = Gearman::Worker.new("localhost:4730")
|
25
|
-
worker.add_ability("foo") {|data, job| "noop!"}
|
26
|
-
worker.add_ability("bar") {|data, job| "nothing to see here!" }
|
27
|
-
worker.remove_ability("bar")
|
28
36
|
|
29
|
-
|
30
|
-
|
37
|
+
def test_job_reconnection
|
38
|
+
server = FakeJobServer.new(self)
|
39
|
+
Thread.new do
|
40
|
+
sock = server.expect_connection
|
41
|
+
server.expect_anything_and_close_socket(sock)
|
42
|
+
end
|
31
43
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
44
|
+
servers = ["localhost:#{server.port}"]
|
45
|
+
w = Gearman::Worker.new(servers)
|
46
|
+
Gearman::Util.stubs(:send_request).raises(Exception.new)
|
47
|
+
w.add_ability('sleep') do |data,job|
|
48
|
+
seconds = data
|
49
|
+
(1..seconds.to_i).each do |i|
|
50
|
+
sleep 1
|
51
|
+
print i
|
52
|
+
# Report our progress to the job server every second.
|
53
|
+
job.report_status(i, seconds)
|
54
|
+
end
|
55
|
+
# Report success.
|
37
56
|
true
|
38
57
|
end
|
39
58
|
|
40
|
-
|
41
|
-
EM.add_timer(0.1) { EM.stop_event_loop }
|
42
|
-
worker.work
|
43
|
-
end
|
59
|
+
assert(w.bad_servers.size == 1)
|
44
60
|
end
|
45
61
|
end
|
metadata
CHANGED
@@ -1,29 +1,32 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gearman-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 3
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
version: 3.0.1
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
12
|
+
- John Ewart
|
13
|
+
- Colin Curtin
|
14
|
+
- Daniel Erat
|
15
|
+
- Ladislav Martincik
|
16
|
+
- Pablo Delgado
|
17
|
+
- Mauro Pompilio
|
18
|
+
- Antonio Garrote
|
7
19
|
- Kim Altintop
|
8
20
|
autorequire:
|
9
21
|
bindir: bin
|
10
22
|
cert_chain: []
|
11
23
|
|
12
|
-
date:
|
24
|
+
date: 2010-07-19 00:00:00 -07:00
|
13
25
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
16
|
-
name: eventmachine
|
17
|
-
type: :runtime
|
18
|
-
version_requirement:
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
20
|
-
requirements:
|
21
|
-
- - ">="
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: 0.12.8
|
24
|
-
version:
|
26
|
+
dependencies: []
|
27
|
+
|
25
28
|
description: Library for the Gearman distributed job system
|
26
|
-
email:
|
29
|
+
email: john@unixninjas.org
|
27
30
|
executables: []
|
28
31
|
|
29
32
|
extensions: []
|
@@ -41,13 +44,14 @@ files:
|
|
41
44
|
- VERSION.yml
|
42
45
|
- examples/calculus_client.rb
|
43
46
|
- examples/calculus_worker.rb
|
47
|
+
- examples/client.php
|
44
48
|
- examples/client.rb
|
45
49
|
- examples/client_background.rb
|
46
50
|
- examples/client_data.rb
|
51
|
+
- examples/client_epoch.rb
|
47
52
|
- examples/client_exception.rb
|
48
53
|
- examples/client_prefix.rb
|
49
|
-
- examples/
|
50
|
-
- examples/evented_worker.rb
|
54
|
+
- examples/client_reverse.rb
|
51
55
|
- examples/gearman_environment.sh
|
52
56
|
- examples/scale_image.rb
|
53
57
|
- examples/scale_image_worker.rb
|
@@ -56,28 +60,24 @@ files:
|
|
56
60
|
- examples/worker_data.rb
|
57
61
|
- examples/worker_exception.rb
|
58
62
|
- examples/worker_prefix.rb
|
59
|
-
-
|
63
|
+
- examples/worker_reverse_string.rb
|
64
|
+
- examples/worker_reverse_to_file.rb
|
65
|
+
- examples/worker_signals.rb
|
60
66
|
- lib/gearman.rb
|
61
67
|
- lib/gearman/client.rb
|
62
|
-
- lib/gearman/evented/client.rb
|
63
|
-
- lib/gearman/evented/reactor.rb
|
64
|
-
- lib/gearman/evented/worker.rb
|
65
|
-
- lib/gearman/job.rb
|
66
|
-
- lib/gearman/protocol.rb
|
67
68
|
- lib/gearman/server.rb
|
68
69
|
- lib/gearman/task.rb
|
69
70
|
- lib/gearman/taskset.rb
|
71
|
+
- lib/gearman/testlib.rb
|
70
72
|
- lib/gearman/util.rb
|
71
73
|
- lib/gearman/worker.rb
|
72
|
-
- test/
|
73
|
-
- test/
|
74
|
-
- test/
|
75
|
-
- test/protocol_test.rb
|
76
|
-
- test/test_helper.rb
|
74
|
+
- test/client_test.rb
|
75
|
+
- test/mock_client_test.rb
|
76
|
+
- test/mock_worker_test.rb
|
77
77
|
- test/util_test.rb
|
78
78
|
- test/worker_test.rb
|
79
79
|
has_rdoc: true
|
80
|
-
homepage: http://github.com/
|
80
|
+
homepage: http://github.com/gearman-ruby/gearman-ruby
|
81
81
|
licenses: []
|
82
82
|
|
83
83
|
post_install_message:
|
@@ -89,27 +89,27 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
89
89
|
requirements:
|
90
90
|
- - ">="
|
91
91
|
- !ruby/object:Gem::Version
|
92
|
+
segments:
|
93
|
+
- 0
|
92
94
|
version: "0"
|
93
|
-
version:
|
94
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
96
|
requirements:
|
96
97
|
- - ">="
|
97
98
|
- !ruby/object:Gem::Version
|
99
|
+
segments:
|
100
|
+
- 0
|
98
101
|
version: "0"
|
99
|
-
version:
|
100
102
|
requirements: []
|
101
103
|
|
102
104
|
rubyforge_project:
|
103
|
-
rubygems_version: 1.3.
|
105
|
+
rubygems_version: 1.3.6
|
104
106
|
signing_key:
|
105
107
|
specification_version: 3
|
106
108
|
summary: Library for the Gearman distributed job system
|
107
109
|
test_files:
|
108
|
-
- test/
|
109
|
-
- test/
|
110
|
-
- test/
|
111
|
-
- test/protocol_test.rb
|
112
|
-
- test/test_helper.rb
|
110
|
+
- test/client_test.rb
|
111
|
+
- test/mock_client_test.rb
|
112
|
+
- test/mock_worker_test.rb
|
113
113
|
- test/util_test.rb
|
114
114
|
- test/worker_test.rb
|
115
115
|
- examples/calculus_client.rb
|
@@ -117,17 +117,17 @@ test_files:
|
|
117
117
|
- examples/client.rb
|
118
118
|
- examples/client_background.rb
|
119
119
|
- examples/client_data.rb
|
120
|
-
- examples/
|
120
|
+
- examples/client_epoch.rb
|
121
121
|
- examples/client_exception.rb
|
122
122
|
- examples/client_prefix.rb
|
123
|
-
- examples/
|
124
|
-
- examples/evented_worker.rb
|
123
|
+
- examples/client_reverse.rb
|
125
124
|
- examples/scale_image.rb
|
126
125
|
- examples/scale_image_worker.rb
|
127
126
|
- examples/server.rb
|
128
127
|
- examples/worker.rb
|
129
128
|
- examples/worker_data.rb
|
130
|
-
- examples/worker_echo.rb
|
131
|
-
- examples/worker_echo_pprof.rb
|
132
129
|
- examples/worker_exception.rb
|
133
130
|
- examples/worker_prefix.rb
|
131
|
+
- examples/worker_reverse_string.rb
|
132
|
+
- examples/worker_reverse_to_file.rb
|
133
|
+
- examples/worker_signals.rb
|