Class: Workling::Clients::BackgroundjobClient
- Defined in:
- lib/workling/clients/backgroundjob_client.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#dispatch(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
#close, #connect, load, #logger, #request, #retrieve, #subscribe
Class Method Details
.installed? ⇒ Boolean
5 6 7 |
# File 'lib/workling/clients/backgroundjob_client.rb', line 5 def self.installed? Object.const_defined? "Bj" end |
Instance Method Details
#dispatch(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.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/workling/clients/backgroundjob_client.rb', line 12 def dispatch(clazz, method, = {}) stdin = Workling::Remote.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 |