Sha256: fa03f8514d458dd79ed86ec9c933853d1bc6e3f560403fbd97866426db7116aa

Contents?: true

Size: 475 Bytes

Versions: 5

Compression:

Stored size: 475 Bytes

Contents

require "queue_classic"

module Devise
  module Async
    module Backend
      class QueueClassic < Base
        def self.enqueue(method, *args)
          queue = ::QC::Queue.new(Devise::Async.queue)
          method = String(method) # QC won't serialize Symbol such as #{method}
          args.unshift("#{self}.perform", method)
          queue.enqueue(*args)
        end

        def self.perform(*args)
          new.perform(*args)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
devise-async-0.10.2 lib/devise/async/backend/queue_classic.rb
devise-async-0.10.1 lib/devise/async/backend/queue_classic.rb
devise-async-0.10.1.alpha lib/devise/async/backend/queue_classic.rb
devise-async-0.9.0 lib/devise/async/backend/queue_classic.rb
devise-async-0.8.0 lib/devise/async/backend/queue_classic.rb