Class: Thin::Async::Test::Callback

Inherits:
Object
  • Object
show all
Defined in:
lib/thin/async/test.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



10
11
12
# File 'lib/thin/async/test.rb', line 10

def body
  @body
end

#headersObject (readonly)

Returns the value of attribute headers.



10
11
12
# File 'lib/thin/async/test.rb', line 10

def headers
  @headers
end

#statusObject (readonly)

Returns the value of attribute status.



10
11
12
# File 'lib/thin/async/test.rb', line 10

def status
  @status
end

Instance Method Details

#call(args) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/thin/async/test.rb', line 12

def call args
  @status, @headers, deferred_body = args
  @body = ""
  deferred_body.each {|s| @body << s }

  deferred_body.callback { EM.stop }
end