Sha256: ff108397407fd607b0e0050c8ab90e7a4e5df95cd6b639f6cc3daaf9dd75c742

Contents?: true

Size: 404 Bytes

Versions: 10

Compression:

Stored size: 404 Bytes

Contents

require 'rubygems'
require '../lib/gearman'

Gearman::Util.debug = true

servers = ['localhost:4730']
w = Gearman::Worker.new(servers)

# Add a handler for a "sleep" function that takes a single argument, the
# number of seconds to sleep before reporting success.
w.add_ability('fail_with_exception') do |data,job|
  raise Exception.new("Exception in worker (args: #{data.inspect})")
end
loop { w.work }

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
gearman-ruby-3.0.8 examples/worker_exception.rb
xing-gearman-ruby-1.2.0 examples/worker_exception.rb
xing-gearman-ruby-1.3.0 examples/worker_exception.rb
xing-gearman-ruby-1.3.1 examples/worker_exception.rb
gearman-ruby-3.0.7 examples/worker_exception.rb
gearman-ruby-3.0.6 examples/worker_exception.rb
gearman-ruby-3.0.4 examples/worker_exception.rb
gearman-ruby-3.0.3 examples/worker_exception.rb
gearman-ruby-3.0.2 examples/worker_exception.rb
gearman-ruby-3.0.1 examples/worker_exception.rb