Class: Workling::Remote::Runners::BackgroundjobRunner
- Defined in:
- lib/workling/remote/runners/backgroundjob_runner.rb
Instance Method Summary collapse
-
#initialize ⇒ BackgroundjobRunner
constructor
A new instance of BackgroundjobRunner.
-
#run(clazz, method, options = {}) ⇒ Object
passes the job to bj by serializing the options to xml and passing them to ./script/bj_invoker.rb, which in turn routes the deserialized args to the appropriate worker.
Methods inherited from Base
Constructor Details
#initialize ⇒ BackgroundjobRunner
Returns a new instance of BackgroundjobRunner.
14 15 16 17 |
# File 'lib/workling/remote/runners/backgroundjob_runner.rb', line 14 def initialize BackgroundjobRunner.routing = Workling::Routing::ClassAndMethodRouting.new end |
Instance Method Details
#run(clazz, method, options = {}) ⇒ Object
passes the job to bj by serializing the options to xml and passing them to
./script/bj_invoker.rb, which in turn routes the deserialized args to the
appropriate worker.
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/workling/remote/runners/backgroundjob_runner.rb', line 22 def run(clazz, method, = {}) stdin = @@routing.queue_for(clazz, method) + " " + .to_xml(:indent => 0, :skip_instruct => true) Bj.submit "./script/runner ./script/bj_invoker.rb", :stdin => stdin return nil # that means nothing! end |