Class: Async::HTTP::Body::Delayed
- Inherits:
-
Protocol::HTTP::Body::Wrapper
- Object
- Protocol::HTTP::Body::Wrapper
- Async::HTTP::Body::Delayed
- Defined in:
- lib/async/http/body/delayed.rb
Instance Method Summary collapse
-
#initialize(body, delay = 0.01) ⇒ Delayed
constructor
A new instance of Delayed.
- #read ⇒ Object
- #ready? ⇒ Boolean
Constructor Details
#initialize(body, delay = 0.01) ⇒ Delayed
Returns a new instance of Delayed.
14 15 16 17 18 |
# File 'lib/async/http/body/delayed.rb', line 14 def initialize(body, delay = 0.01) super(body) @delay = delay end |
Instance Method Details
#read ⇒ Object
24 25 26 27 28 |
# File 'lib/async/http/body/delayed.rb', line 24 def read Async::Task.current.sleep(@delay) return super end |
#ready? ⇒ Boolean
20 21 22 |
# File 'lib/async/http/body/delayed.rb', line 20 def ready? false end |