Class Rddb::Worker::LocalWorker
In: lib/rddb/worker/local_worker.rb
Parent: Object

Instances of the LocalWorker class are executed in the current application.

Methods

new   process   run  

Public Class methods

Initialize the worker with the specified options

[Source]

   # File lib/rddb/worker/local_worker.rb, line 7
7:       def initialize(options={})
8:         @options = options
9:       end

Process the specified tasks.

[Source]

    # 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

Public Instance methods

Run the worker service.

[Source]

    # File lib/rddb/worker/local_worker.rb, line 23
23:       def run
24:         # no op
25:       end

[Validate]