Sha256: 05ed55a9faca5e42ea8811dea96fe15381ad70c6b85c284141994bf7f1eef0fd
Contents?: true
Size: 894 Bytes
Versions: 2
Compression:
Stored size: 894 Bytes
Contents
require "active_job/queue_adapters/active_beaneater_adapter" require "active_beaneater/version" require "active_beaneater/queue_options" require "active_beaneater/worker" require "ostruct" require "beaneater" module URI class BEANSTALK < Generic DEFAULT_PORT = 11300 end @@schemes['BEANSTALK'] = BEANSTALK end module ActiveBeaneater def self.configure url = ENV['BEANSTALK_URL'] url ||= ['beanstalk://localhost'] uri = URI(url) config = { client: Beaneater.new("#{uri.host}:#{uri.port}"), prefix: 'active-beaneater' } config = OpenStruct.new(config) yield(config) if block_given? Rails.application.config.beaneater = config.freeze end def self.resolve_queue_name(queue) prefix = Rails.application.config.beaneater.prefix prefix = [prefix] if !prefix.respond_to?(:to_ary) (prefix + [queue]).join('.') end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
active_beaneater-0.1.1 | lib/active_beaneater.rb |
active_beaneater-0.1.0 | lib/active_beaneater.rb |