Class: RailsPushQueues::QueueComm
- Inherits:
-
Object
- Object
- RailsPushQueues::QueueComm
- Defined in:
- lib/rails_push_queues/main.rb
Instance Attribute Summary collapse
-
#mq ⇒ Object
Returns the value of attribute mq.
Instance Method Summary collapse
-
#initialize ⇒ QueueComm
constructor
A new instance of QueueComm.
- #queue_job(clz, *args) ⇒ Object
Constructor Details
#initialize ⇒ QueueComm
Returns a new instance of QueueComm.
13 14 15 16 17 |
# File 'lib/rails_push_queues/main.rb', line 13 def initialize # todo: load up config stuff from config file @mq = IronMQ::Client.new(token: RailsPushQueues.iron_token, project_id: RailsPushQueues.iron_project_id) end |
Instance Attribute Details
#mq ⇒ Object
Returns the value of attribute mq.
11 12 13 |
# File 'lib/rails_push_queues/main.rb', line 11 def mq @mq end |
Instance Method Details
#queue_job(clz, *args) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/rails_push_queues/main.rb', line 19 def queue_job(clz, *args) queue_name = "railspushtest" if !clz.is_a?(String) clz = self.name end body = {"class"=>clz, "args"=>[]} args.each do |a| body["args"] << a end q = RailsPushQueues.ironmq.queue(clz) q.post(body.to_json) end |