Class: Raptor::Reactor::ConnectionIO

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

Overview

Tracks reactor-owned output state for a connection.

Direct Known Subclasses

Http1IO, Http2IO

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize ⇒ ConnectionIO

Creates empty connection I/O state for reactor-owned writes.



93
94
95
96
97
98
99
100
101
# File 'lib/raptor/reactor.rb', line 93

def initialize
  @output = []
  @offset = 0
  @wait = nil
  @reading = false
  @closing = false
  @monitor = nil
  @timeout = nil
end

Instance Attribute Details

#closing ⇒ Object

Returns the value of attribute closing.

Returns:

  • (Object)


77
78
79
# File 'lib/raptor/reactor.rb', line 77

def closing
  @closing
end

#monitor ⇒ Object

Returns the value of attribute monitor.

Returns:

  • (Object)


80
81
82
# File 'lib/raptor/reactor.rb', line 80

def monitor
  @monitor
end

#offset ⇒ Object

Returns the value of attribute offset.

Returns:

  • (Object)


68
69
70
# File 'lib/raptor/reactor.rb', line 68

def offset
  @offset
end

#output ⇒ Object (readonly)

Returns the value of attribute output.

Returns:

  • (Object)


86
87
88
# File 'lib/raptor/reactor.rb', line 86

def output
  @output
end

#reading ⇒ Object

Returns the value of attribute reading.

Returns:

  • (Object)


74
75
76
# File 'lib/raptor/reactor.rb', line 74

def reading
  @reading
end

#timeout ⇒ Object

Returns the value of attribute timeout.

Returns:

  • (Object)


83
84
85
# File 'lib/raptor/reactor.rb', line 83

def timeout
  @timeout
end

#wait ⇒ Object

Returns the value of attribute wait.

Returns:

  • (Object)


71
72
73
# File 'lib/raptor/reactor.rb', line 71

def wait
  @wait
end

Instance Method Details

#empty? ⇒ Boolean

Returns whether the connection has no output waiting to be written.

Returns:

  • (Boolean)


108
109
110
# File 'lib/raptor/reactor.rb', line 108

def empty?
  output.empty?
end