Class: Thin::DeferrableBody

Inherits:
Object
  • Object
show all
Includes:
EM::Deferrable
Defined in:
lib/thin/async.rb

Instance Method Summary collapse

Constructor Details

#initializeDeferrableBody

Returns a new instance of DeferrableBody.


7
8
9
# File 'lib/thin/async.rb', line 7

def initialize
  @queue = []
end

Instance Method Details

#call(body) ⇒ Object


11
12
13
14
# File 'lib/thin/async.rb', line 11

def call(body)
  @queue << body
  schedule_dequeue
end

#each(&blk) ⇒ Object


16
17
18
19
# File 'lib/thin/async.rb', line 16

def each(&blk)
  @body_callback = blk
  schedule_dequeue
end