Sha256: ec2d67f83e84c1163b1bea35998751ce78679d0a2d122000d06540f01858fc55

Contents?: true

Size: 566 Bytes

Versions: 10

Compression:

Stored size: 566 Bytes

Contents

require 'rubygems'
require '../lib/gearman'
Gearman::Util.debug = true

servers = ['localhost:4730']

client = Gearman::Client.new(servers)
taskset = Gearman::TaskSet.new(client)

task = Gearman::Task.new('fail_with_exception', "void")
task.retry_count = 2
task.on_complete {|d| puts d }
task.on_exception {|ex| puts "This should never be called" }
task.on_warning {|warning| puts "WARNING: #{warning}" }
task.on_retry { puts "PRE-RETRY HOOK: retry no. #{task.retries_done}" }
task.on_fail { puts "TASK FAILED, GIVING UP" }

taskset.add_task(task)
taskset.wait(100)

Version data entries

10 entries across 10 versions & 2 rubygems

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