Class: Raptor::Reactor::Http2IO

Inherits:
ConnectionIO show all
Defined in:
lib/raptor/reactor.rb,
sig/generated/raptor/reactor.rbs

Overview

Tracks reactor-owned I/O state for an HTTP/2 connection.

Instance Attribute Summary collapse

Attributes inherited from ConnectionIO

#closing, #monitor, #offset, #output, #reading, #timeout, #wait

Instance Method Summary collapse

Constructor Details

#initialize ⇒ Http2IO

Creates empty I/O state for an HTTP/2 connection and its detached streams.



178
179
180
181
182
183
184
# File 'lib/raptor/reactor.rb', line 178

def initialize
  super
  @detached = {}
  @ready = []
  @ready_streams = {}
  @budget = DetachedBody::Budget.new(DETACHED_CONNECTION_BUFFER_SIZE)
end

Instance Attribute Details

#budget ⇒ Object (readonly)

Returns the value of attribute budget.

Returns:

  • (Object)


171
172
173
# File 'lib/raptor/reactor.rb', line 171

def budget
  @budget
end

#detached ⇒ Object (readonly)

Returns the value of attribute detached.

Returns:

  • (Object)


162
163
164
# File 'lib/raptor/reactor.rb', line 162

def detached
  @detached
end

#ready ⇒ Object (readonly)

Returns the value of attribute ready.

Returns:

  • (Object)


165
166
167
# File 'lib/raptor/reactor.rb', line 165

def ready
  @ready
end

#ready_streams ⇒ Object (readonly)

Returns the value of attribute ready_streams.

Returns:

  • (Object)


168
169
170
# File 'lib/raptor/reactor.rb', line 168

def ready_streams
  @ready_streams
end

Instance Method Details

#empty? ⇒ Boolean

Returns whether the connection has no output or detached streams remaining.

Returns:

  • (Boolean)


191
192
193
# File 'lib/raptor/reactor.rb', line 191

def empty?
  super && detached.empty?
end