Sha256: 8a332cda680b50e05c7604e19556a8a5e4d7958d9f2c7c5d8b06170c20c02833

Contents?: true

Size: 702 Bytes

Versions: 7

Compression:

Stored size: 702 Bytes

Contents

# Start up a Resque Worker to run the Job Request
require 'rubygems'
require 'resque'
require 'resque/job_with_status'
require 'sleep_job'
require 'hornetq_job'

# Number of workers to start (each on its own thread)
thread_count = (ARGV[0] || 1).to_i

# Configure Redis client connection
Resque.redis = "localhost:6379"

# How long to keep Job status for in seconds
Resque::Status.expire_in = (24 * 60 * 60) # 24hrs in seconds

# Start the worker instance(s) in which Jobs are run
resque_worker = Resque::Worker.new("hornetq_job")
resque_worker.log "Starting worker #{resque_worker}"
resque_worker.verbose = true
resque_worker.very_verbose = true
resque_worker.work(5) # Redis Poll interval in seconds

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
jruby-hornetq-0.5.0.alpha examples/resque/resque_worker.rb
jruby-hornetq-0.4.0 examples/resque/resque_worker.rb
jruby-hornetq-0.3.3 examples/resque/resque_worker.rb
jruby-hornetq-0.3.2 examples/resque/resque_worker.rb
jruby-hornetq-0.3.1 examples/resque/resque_worker.rb
jruby-hornetq-0.3.0.alpha examples/resque/resque_worker.rb
jruby-hornetq-0.2.5.alpha examples/client/resque/resque_worker.rb