Class: NFAgent::Event

Inherits:
EventMachine::Connection
  • Object
show all
Defined in:
lib/nfagent/event.rb

Instance Method Summary collapse

Constructor Details

#initialize(chunk_handler, poller) ⇒ Event

Returns a new instance of Event.



3
4
5
6
# File 'lib/nfagent/event.rb', line 3

def initialize(chunk_handler, poller)
  @handler = chunk_handler
  @poller = poller
end

Instance Method Details

#associate_callback_target(sig) ⇒ Object



23
24
25
# File 'lib/nfagent/event.rb', line 23

def associate_callback_target(sig)
  # Take no action
end

#post_initObject



8
9
10
# File 'lib/nfagent/event.rb', line 8

def post_init
  Log.info "Client Connected"
end

#receive_data(data) ⇒ Object



12
13
14
15
16
17
# File 'lib/nfagent/event.rb', line 12

def receive_data(data)
  if data && data.length > 10
    @handler.append(data)
  end
  #send_data('OK')
end

#unbindObject



19
20
21
# File 'lib/nfagent/event.rb', line 19

def unbind
  Log.info "Disconnected"
end