Sha256: 079a0e32a7d4f4935cbc3d10269374ec3319d8d108daac02a129c54d5d23a212

Contents?: true

Size: 1.73 KB

Versions: 2

Compression:

Stored size: 1.73 KB

Contents

require "active_support/dependencies"
require "devise/async/version"

module Devise
  module Async
    autoload :Worker,  "devise/async/worker"
    autoload :Backend, "devise/async/backend"
    autoload :Model,   "devise/async/model"

    module Backend
      autoload :Base,         "devise/async/backend/base"
      autoload :Backburner,   "devise/async/backend/backburner"
      autoload :Resque,       "devise/async/backend/resque"
      autoload :Sidekiq,      "devise/async/backend/sidekiq"
      autoload :DelayedJob,   "devise/async/backend/delayed_job"
      autoload :QueueClassic, "devise/async/backend/queue_classic"
      autoload :Torquebox,    "devise/async/backend/torquebox"
      autoload :SuckerPunch,  "devise/async/backend/sucker_punch"
      autoload :Que,          "devise/async/backend/que"
    end

    # Defines the queue backend to be used. Resque by default.
    mattr_accessor :backend
    @@backend = :resque

    # Defines the queue in which the background job will be enqueued. Default is :mailer.
    mattr_accessor :queue
    @@queue = :mailer

    # Defines the priority in which the background job will be enqueued. Defaults to the default of the backend you are using.
    mattr_accessor :priority
    @@priority = nil

    # Defines the enabled configuration that if set to false the emails will be sent synchronously
    mattr_accessor :enabled
    @@enabled = true

    # Allow configuring Devise::Async with a block
    #
    # Example:
    #
    #     Devise::Async.setup do |config|
    #       config.backend = :resque
    #       config.queue   = :my_custom_queue
    #     end
    def self.setup
      yield self
    end
  end
end

# Register devise-async model in Devise
Devise.add_module(:async, :model => 'devise/async/model')

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
devise-async-0.10.1 lib/devise/async.rb
devise-async-0.10.1.alpha lib/devise/async.rb