Class: Atatus::Transport::Connection::ProxyPipe Private

Inherits:
Object
  • Object
show all
Defined in:
lib/atatus/transport/connection/proxy_pipe.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Defined Under Namespace

Classes: Write

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enc = nil, compress: true) ⇒ ProxyPipe

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ProxyPipe.



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/atatus/transport/connection/proxy_pipe.rb', line 25

def initialize(enc = nil, compress: true)
  rd, wr = IO.pipe(enc)

  @read = rd
  @write = Write.new(wr, compress: compress)

  # Http.rb<4 calls rewind on the request bodies, but IO::Pipe raises
  # ~mikker
  return if HTTP::VERSION.to_i >= 4
  def rd.rewind; end
end

Instance Attribute Details

#readObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



37
38
39
# File 'lib/atatus/transport/connection/proxy_pipe.rb', line 37

def read
  @read
end

#writeObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



37
38
39
# File 'lib/atatus/transport/connection/proxy_pipe.rb', line 37

def write
  @write
end

Class Method Details

.pipe(**args) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



86
87
88
89
# File 'lib/atatus/transport/connection/proxy_pipe.rb', line 86

def self.pipe(**args)
  pipe = new(**args)
  [pipe.read, pipe.write]
end