Class: NIO::WebSocket::Adapter::ProxyAdapter

Inherits:
RawAdapter
  • Object
show all
Defined in:
lib/nio/websocket/adapter/proxy.rb

Instance Attribute Summary

Attributes inherited from RawAdapter

#closing, #inner, #monitor, #options

Instance Method Summary collapse

Methods inherited from RawAdapter

#add_to_reactor, #close, #pump_buffer, #teardown, #write

Constructor Details

#initialize(io, options, &block) ⇒ ProxyAdapter

Returns a new instance of ProxyAdapter.



25
26
27
28
# File 'lib/nio/websocket/adapter/proxy.rb', line 25

def initialize(io, options, &block)
  super io, options
  @read_event = block
end

Instance Method Details

#readObject



30
31
32
33
34
# File 'lib/nio/websocket/adapter/proxy.rb', line 30

def read
  super do |data|
    @read_event.call data
  end
end