Class: Tep::Proxy::ProxyStreamer

Inherits:
Streamer
  • Object
show all
Defined in:
lib/tep/proxy.rb

Overview

Thin Streamer shim. Holds the held-open upstream fd + state and delegates the actual pump to @proxy.run_stream. The work lives on Tep::Proxy (not here) so the per-chunk / end hooks dispatch through ‘self` – a polymorphic-self call inside a base-Proxy method reaches subclass overrides, whereas a call through this object’s @proxy slot (statically base-typed) would only ever hit the base hooks. See run_stream’s comment + [[spinel-widening-dispatch]].

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeProxyStreamer

Returns a new instance of ProxyStreamer.



787
788
789
790
791
792
793
794
# File 'lib/tep/proxy.rb', line 787

def initialize
  @proxy      = Tep::Proxy.new("")
  @fd         = -1
  @leftover   = ""
  @is_chunked = false
  @is_sse     = false
  @req        = Tep::Request.new
end

Instance Attribute Details

#fdObject

Returns the value of attribute fd.



785
786
787
# File 'lib/tep/proxy.rb', line 785

def fd
  @fd
end

#is_chunkedObject

Returns the value of attribute is_chunked.



785
786
787
# File 'lib/tep/proxy.rb', line 785

def is_chunked
  @is_chunked
end

#is_sseObject

Returns the value of attribute is_sse.



785
786
787
# File 'lib/tep/proxy.rb', line 785

def is_sse
  @is_sse
end

#leftoverObject

Returns the value of attribute leftover.



785
786
787
# File 'lib/tep/proxy.rb', line 785

def leftover
  @leftover
end

#proxyObject

Returns the value of attribute proxy.



785
786
787
# File 'lib/tep/proxy.rb', line 785

def proxy
  @proxy
end

#reqObject

Returns the value of attribute req.



785
786
787
# File 'lib/tep/proxy.rb', line 785

def req
  @req
end

Instance Method Details

#pump(out) ⇒ Object



796
797
798
# File 'lib/tep/proxy.rb', line 796

def pump(out)
  @proxy.run_stream(out, @fd, @leftover, @is_chunked, @is_sse, @req)
end