Class: Raptor::Reactor::Http1IO
- Inherits:
-
ConnectionIO
- Object
- ConnectionIO
- Raptor::Reactor::Http1IO
- Defined in:
- lib/raptor/reactor.rb,
sig/generated/raptor/reactor.rbs
Overview
Tracks reactor-owned I/O state for an HTTP/1.x detached response.
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#budget ⇒ Object
readonly
Returns the value of attribute budget.
-
#finishing ⇒ Object
Returns the value of attribute finishing.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Attributes inherited from ConnectionIO
#closing, #monitor, #offset, #output, #reading, #timeout, #wait
Instance Method Summary collapse
-
#empty? ⇒ Boolean
Returns whether the connection has no output or detached body remaining.
-
#initialize(body, state) ⇒ Http1IO
constructor
Creates I/O state for an HTTP/1.x detached response.
Constructor Details
#initialize(body, state) ⇒ Http1IO
Creates I/O state for an HTTP/1.x detached response.
138 139 140 141 142 143 144 145 146 |
# File 'lib/raptor/reactor.rb', line 138 def initialize(body, state) super() @body = body @state = state @budget = DetachedBody::Budget.new(DETACHED_CONNECTION_BUFFER_SIZE) @input = String.new(encoding: Encoding::ASCII_8BIT) @reading = true @finishing = false end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
117 118 119 |
# File 'lib/raptor/reactor.rb', line 117 def body @body end |
#budget ⇒ Object (readonly)
Returns the value of attribute budget.
123 124 125 |
# File 'lib/raptor/reactor.rb', line 123 def budget @budget end |
#finishing ⇒ Object
Returns the value of attribute finishing.
120 121 122 |
# File 'lib/raptor/reactor.rb', line 120 def finishing @finishing end |
#input ⇒ Object (readonly)
Returns the value of attribute input.
126 127 128 |
# File 'lib/raptor/reactor.rb', line 126 def input @input end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
129 130 131 |
# File 'lib/raptor/reactor.rb', line 129 def state @state end |
Instance Method Details
#empty? ⇒ Boolean
Returns whether the connection has no output or detached body remaining.
153 154 155 |
# File 'lib/raptor/reactor.rb', line 153 def empty? super && !body end |