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
data/test/test_helper.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
$:.unshift(File.expand_path(File.dirname(__FILE__) + '/../lib'))
|
2
|
-
require 'gearman'
|
3
|
-
require 'test/unit'
|
4
|
-
require 'mocha'
|
5
|
-
|
6
|
-
def start_gearmand(port = 4730, debug = false)
|
7
|
-
log = debug ? "-l /tmp/gearmand.log -vvv" : ""
|
8
|
-
system "gearmand -d -p #{port} --pid-file=#{gearmand_pidfile(port)} #{log}"
|
9
|
-
gearmand_pid(port)
|
10
|
-
end
|
11
|
-
|
12
|
-
def stop_gearmand(port = 4730)
|
13
|
-
Process.kill "KILL", gearmand_pid(port)
|
14
|
-
File.unlink gearmand_pidfile(port)
|
15
|
-
end
|
16
|
-
|
17
|
-
def teardown_gearmands
|
18
|
-
glob = "/tmp/gearmand_*_#{$$}.pid"
|
19
|
-
Dir[glob].each do |pidfile|
|
20
|
-
Process.kill "KILL", `cat #{pidfile}`.to_i
|
21
|
-
File.unlink pidfile
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def gearmand_pid(port = 4730)
|
26
|
-
`cat #{gearmand_pidfile(port)}`.to_i
|
27
|
-
end
|
28
|
-
|
29
|
-
def gearmand_pidfile(port)
|
30
|
-
"/tmp/gearmand_#{port}_#{$$}.pid"
|
31
|
-
end
|