Sha256: 8d8c6b957135f9c7dabe11c01ca3a9d85863a4511f0ea5761ea9c21673ec42ca

Contents?: true

Size: 355 Bytes

Versions: 4

Compression:

Stored size: 355 Bytes

Contents

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

servers = ['localhost:4730', 'localhost:4731']
  
client = Gearman::Client.new(servers)
taskset = Gearman::TaskSet.new(client)

task = Gearman::Task.new('sleep', 20, { :background => true })
task.on_complete {|d| puts d }

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
xing-gearman-ruby-1.1.0 examples/client_background.rb
xing-gearman-ruby-1.2.0 examples/client_background.rb
xing-gearman-ruby-1.3.0 examples/client_background.rb
xing-gearman-ruby-1.3.1 examples/client_background.rb