Sha256: d564dc12df00dffd9b7648fed0a04b89cc047ba713ad34bdbc326f2a5e837855

Contents?: true

Size: 473 Bytes

Versions: 1

Compression:

Stored size: 473 Bytes

Contents

module Afterparty
  class Queue
    attr_accessor :options, :temp_namespace, :login_block
    include Afterparty::QueueHelpers

    def push job
      return nil if job.nil?
      AfterpartyJob.make_with_job job, @options[:namespace]
    end
    alias :<< :push
    alias :eng :push

    def pop
      while true do
        unless (_job = next_valid_job).nil?
          _job.save
          return _job
        end
        sleep(@options[:sleep])
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
afterparty-0.2.0 lib/afterparty/queue.rb