Class: FFWD::Connection

Inherits:
EM::Connection
  • Object
show all
Defined in:
lib/ffwd/connection.rb

Overview

Connections are used by input plugins in the protocol stack.

The sole purpose this exists is to incorporate a datasink functionality in the EM::Connection.

The datasink is used by tunnels to ‘hook into’ outgoing data.

Direct Known Subclasses

Handler, Plugin::JSON::Connection

Instance Method Summary collapse

Instance Method Details

#datasink=(sink) ⇒ Object



26
27
28
# File 'lib/ffwd/connection.rb', line 26

def datasink= sink
  @datasink = sink
end

#send_data(data) ⇒ Object

send_data indirection.



31
32
33
34
35
36
37
38
# File 'lib/ffwd/connection.rb', line 31

def send_data data
  if @datasink
    @datasink.send_data data
    return
  end

  super data
end