Sha256: 3db91cf77d87c4fda849e3c99de1e2b3baf0378e2b8aa1af80c9261e8cd3f254

Contents?: true

Size: 650 Bytes

Versions: 1

Compression:

Stored size: 650 Bytes

Contents

module RailsPushQueues

  def self.queue_job(clz, *args)
    @@qcomm.queue_job(clz, *args)
  end

  class QueueComm

    attr_accessor :mq

    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

    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

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_push_queues-0.0.1 lib/rails_push_queues/main.rb