Method: Kronk::QueueRunner#initialize
- Defined in:
- lib/kronk/queue_runner.rb
#initialize(opts = {}) ⇒ QueueRunner
Create a new QueueRunner for batch multi-threaded processing. Supported options are:
- :number
-
Fixnum - Total number of items to process
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/kronk/queue_runner.rb', line 63 def initialize opts={} @number = opts[:number] @count = 0 @queue = [] @threads = [] @rthreads = [] @max_queue_size = 100 @reader_thread = nil @triggers = {} @qmutex = Mutex.new end |