Class: Async::HTTP::Body::Delayed
- Defined in:
- lib/async/http/body/delayed.rb
Instance Attribute Summary
Attributes inherited from Wrapper
Instance Method Summary collapse
-
#initialize(body, delay = 0.01) ⇒ Delayed
constructor
A new instance of Delayed.
- #read ⇒ Object
Methods inherited from Wrapper
#close, #empty?, #finish, #inspect, #length
Methods inherited from Readable
#close, #each, #empty?, #finish, #join, #length
Constructor Details
#initialize(body, delay = 0.01) ⇒ Delayed
Returns a new instance of Delayed.
27 28 29 30 31 |
# File 'lib/async/http/body/delayed.rb', line 27 def initialize(body, delay = 0.01) super(body) @delay = delay end |
Instance Method Details
#read ⇒ Object
33 34 35 36 37 |
# File 'lib/async/http/body/delayed.rb', line 33 def read Async::Task.current.sleep(@delay) return super end |