Sha256: ac309dd6d4e065fc65fbd17e859ffc8e5c32101b7448f05b395a46a913bf0714

Contents?: true

Size: 355 Bytes

Versions: 5

Compression:

Stored size: 355 Bytes

Contents

require 'iron_mq'

class Fanforce::Workers::Iron

  def initialize(opts={})
    @mq_client = IronMQ::Client.new(:token => opts[:token] || ENV['IRON_TOKEN'], :project_id => opts[:project_id] || ENV['IRON_PROJECT_ID'])
  end

  def enqueue(queue_id, payload)
    @mq_client.queue(queue_id).post(payload.to_json)
  end

  def client
    @mq_client
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fanforce-workers-0.5.5 lib/fanforce/workers/iron.rb
fanforce-workers-0.5.4 lib/fanforce/workers/iron.rb
fanforce-workers-0.5.3 lib/fanforce/workers/iron.rb
fanforce-workers-0.5.2 lib/fanforce/workers/iron.rb
fanforce-workers-0.5.1 lib/fanforce/workers/iron.rb