Sha256: d52c51f9e6fa9061c037e2d69c973cb3598b4b1942e2a6879548fe2b22f414f9

Contents?: true

Size: 547 Bytes

Versions: 2

Compression:

Stored size: 547 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(method, resource_class, resource_id, opts)
          new.perform(method, resource_class, resource_id, opts)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
devise-async-0.7.0 lib/devise/async/backend/queue_classic.rb
devise-async-0.6.0 lib/devise/async/backend/queue_classic.rb