Sha256: 1db6eaf80492e16d31869ebb37c826e1e118f8daec03c41483e7a695ccbaad7e

Contents?: true

Size: 497 Bytes

Versions: 1

Compression:

Stored size: 497 Bytes

Contents

# frozen_string_literal: true

require 'resque'
require 'active_support/all'

module LazyResque
  # A controller concern that appends an after_action to ensure the
  # lazily enqueued Resque enqueues during the request cycle are actually
  # enqueued at the end of the request.
  module ControllerEnqueue
    extend ActiveSupport::Concern

    included do
      append_after_action :process_lazy_enqueues
    end

    def process_lazy_enqueues
      Resque.process_lazy_enqueues
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lazy_resque-0.0.1 lib/lazy_resque/controller_enqueue.rb