Class: FluQ::Input::Socket::Connection

Inherits:
EventMachine::Connection
  • Object
show all
Includes:
Mixins::Loggable
Defined in:
lib/fluq/input/socket/connection.rb

Instance Method Summary collapse

Methods included from Mixins::Loggable

#logger

Constructor Details

#initialize(parent) ⇒ Connection

Constructor

Parameters:



6
7
8
9
# File 'lib/fluq/input/socket/connection.rb', line 6

def initialize(parent)
  super()
  @parent = parent
end

Instance Method Details

#post_initObject

Callback



12
13
14
# File 'lib/fluq/input/socket/connection.rb', line 12

def post_init
  self.comm_inactivity_timeout = 60
end

#receive_data(data) ⇒ Object

Callback



17
18
19
20
21
22
# File 'lib/fluq/input/socket/connection.rb', line 17

def receive_data(data)
  buffer.write(data)
  flush! if buffer.full?
rescue => ex
  logger.crash "#{self.class.name} failure: #{ex.message} (#{ex.class.name})", ex
end

#unbindObject

Callback



25
26
27
# File 'lib/fluq/input/socket/connection.rb', line 25

def unbind
  flush!
end