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.



88
89
90
91
92
93
94
95
96
# File 'lib/raptor/reactor.rb', line 88

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

Instance Attribute Details

#closing ⇒ Boolean

: bool

Returns:

  • (Boolean)


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

def closing
  @closing
end

#monitor ⇒ NIO::Monitor?

: NIO::Monitor?

Returns:

  • (NIO::Monitor, nil)


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

def monitor
  @monitor
end

#offset ⇒ Integer

: Integer

Returns:

  • (Integer)


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

def offset
  @offset
end

#output ⇒ Array[String] (readonly)

: Array

Returns:

  • (Array[String])


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

def output
  @output
end

#reading ⇒ Boolean

: bool

Returns:

  • (Boolean)


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

def reading
  @reading
end

#timeout ⇒ TimeoutClient?

: TimeoutClient?

Returns:



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

def timeout
  @timeout
end

#wait ⇒ Symbol?

: Symbol?

Returns:

  • (Symbol, nil)


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

def wait
  @wait
end

Instance Method Details

#empty? ⇒ Boolean

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

Returns:

  • (Boolean)


103
104
105
# File 'lib/raptor/reactor.rb', line 103

def empty?
  output.empty?
end