aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/body_parts/queued.rb
blob: f8501f6a85a0f88f66135fa070559fa0ba329381 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require 'action_view/body_parts/future'

module ActionView
  module BodyParts
    class Queued < Future
      def initialize(job, &block)
        super(&block)
        enqueue(job)
      end

      protected
        def enqueue(job)
          @receipt = submit(job)
        end

        def finish
          @parts << redeem(@receipt)
        end
    end
  end
end