| Class | Rddb::Worker::LocalWorker |
| In: |
lib/rddb/worker/local_worker.rb
|
| Parent: | Object |
Instances of the LocalWorker class are executed in the current application.
Initialize the worker with the specified options
# File lib/rddb/worker/local_worker.rb, line 7 7: def initialize(options={}) 8: @options = options 9: end
Process the specified tasks.
# File lib/rddb/worker/local_worker.rb, line 12
12: def self.process(tasks)
13: returning Array.new do |results|
14: # What I'd really like to do here is just flatten then results,
15: # however only to a certain depth (i.e. I only want to flatten
16: # the first layer of the array, not records that are returned
17: # as arrays)
18: tasks.each { |t| t.run.each { |r| results << r }}
19: end
20: end