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.



157
158
159
160
161
162
163
# File 'lib/raptor/reactor.rb', line 157

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

Instance Attribute Details

#budget ⇒ DetachedBody::Budget (readonly)

: DetachedBody::Budget



150
151
152
# File 'lib/raptor/reactor.rb', line 150

def budget
  @budget
end

#detached ⇒ Hash[Integer, DetachedBody] (readonly)

: Hash[Integer, DetachedBody]

Returns:



147
148
149
# File 'lib/raptor/reactor.rb', line 147

def detached
  @detached
end

#ready ⇒ Array[Integer] (readonly)

: Array

Returns:

  • (Array[Integer])


148
149
150
# File 'lib/raptor/reactor.rb', line 148

def ready
  @ready
end

#ready_streams ⇒ Hash[Integer, bool] (readonly)

: Hash[Integer, bool]

Returns:

  • (Hash[Integer, bool])


149
150
151
# File 'lib/raptor/reactor.rb', line 149

def ready_streams
  @ready_streams
end

Instance Method Details

#empty? ⇒ Boolean

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

Returns:

  • (Boolean)


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

def empty?
  super && detached.empty?
end