Sha256: 4b14bdd888b17d9ab5f5723d773960ed170035070018039412d2b7e4c05d9873

Contents?: true

Size: 599 Bytes

Versions: 6

Compression:

Stored size: 599 Bytes

Contents

#!/usr/bin/env ruby
require 'rubygems'
require '../lib/gearman'

# Client using Gearman SUBMIT_JOB_EPOCH (currently requires the gearmand branch lp:~jewart/gearmand/scheduled_jobs_support/)

t = nil
threadcounter = 0

client = Gearman::Client.new('localhost')

  
myid = threadcounter 
threadcounter += 1
taskset = Gearman::TaskSet.new(client)
  
(1..10000).each do |jid|
  data = rand(36**8).to_s(36)
  result = data.reverse

  task = Gearman::Task.new("reverse_string", data)
  puts "#{jid} #{data}"
        
  time = Time.now() + rand(120) + 10
  task.schedule(time)
  taskset.add_task(task)
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gearman-ruby-3.0.8 examples/client_reverse.rb
gearman-ruby-3.0.7 examples/client_reverse.rb
gearman-ruby-3.0.6 examples/client_reverse.rb
gearman-ruby-3.0.4 examples/client_reverse.rb
gearman-ruby-3.0.3 examples/client_reverse.rb
gearman-ruby-3.0.1 examples/client_reverse.rb