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 ⇒ DetachedBody?
: DetachedBody?.
-
#budget ⇒ DetachedBody::Budget
readonly
: DetachedBody::Budget.
-
#finishing ⇒ Boolean
: bool.
-
#input ⇒ String
readonly
: String.
-
#state ⇒ Hash[Symbol, untyped]
readonly
: Hash[Symbol, untyped].
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.
124 125 126 127 128 129 130 131 132 |
# File 'lib/raptor/reactor.rb', line 124 def initialize(body, state) super() @body = body @state = state @budget = DetachedBody::Budget.new(DETACHED_CONNECTION_BUFFER_SIZE) @input = String.new(state[:pipelined] || "", encoding: Encoding::ASCII_8BIT) @reading = true @finishing = false end |
Instance Attribute Details
#body ⇒ DetachedBody?
: DetachedBody?
111 112 113 |
# File 'lib/raptor/reactor.rb', line 111 def body @body end |
#budget ⇒ DetachedBody::Budget (readonly)
: DetachedBody::Budget
113 114 115 |
# File 'lib/raptor/reactor.rb', line 113 def budget @budget end |
#finishing ⇒ Boolean
: bool
112 113 114 |
# File 'lib/raptor/reactor.rb', line 112 def finishing @finishing end |
#input ⇒ String (readonly)
: String
114 115 116 |
# File 'lib/raptor/reactor.rb', line 114 def input @input end |
#state ⇒ Hash[Symbol, untyped] (readonly)
: Hash[Symbol, untyped]
115 116 117 |
# File 'lib/raptor/reactor.rb', line 115 def state @state end |
Instance Method Details
#empty? ⇒ Boolean
Returns whether the connection has no output or detached body remaining.
139 140 141 |
# File 'lib/raptor/reactor.rb', line 139 def empty? super && !body end |