Sha256: cfda45e5e6ded72df91304f45332aa65bdda53b112aea703557ded1567e74b81

Contents?: true

Size: 959 Bytes

Versions: 8

Compression:

Stored size: 959 Bytes

Contents

module Backburner
  module Queue
    def self.included(base)
      base.send(:extend, Backburner::Helpers)
      base.send(:extend, Backburner::Hooks)
      base.extend ClassMethods
      Backburner::Worker.known_queue_classes << base
    end

    module ClassMethods
      # Returns or assigns queue name for this job.
      #
      # @example
      #   queue "some.task.name"
      #   @klass.queue # => "some.task.name"
      #
      def queue(name=nil)
        if name
          @queue_name = name
        else # accessor
          @queue_name || dasherize(self.name)
        end
      end

      # Returns or assigns queue priority for this job
      #
      # @example
      #   queue_priority 120
      #   @klass.queue_priority # => 120
      #
      def queue_priority(pri=nil)
        if pri
          @queue_priority = pri
        else # accessor
          @queue_priority
        end
      end
    end # ClassMethods
  end # Queue
end # Backburner

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
backburner-0.3.4 lib/backburner/queue.rb
backburner-0.3.3 lib/backburner/queue.rb
backburner-0.3.2 lib/backburner/queue.rb
backburner-0.3.1 lib/backburner/queue.rb
backburner-0.3.0 lib/backburner/queue.rb
backburner-0.2.6 lib/backburner/queue.rb
backburner-0.2.5 lib/backburner/queue.rb
backburner-0.2.0 lib/backburner/queue.rb