class EM::Nodes::Client

Attributes

alive[R]

Public Class Methods

connect(host, port = nil, *args, &block) click to toggle source
# File lib/em-nodes/client.rb, line 23
def self.connect(host, port = nil, *args, &block)
  EM::Nodes.logger.info { "Connecting to server #{host}#{port ? ':' + port.to_s : nil}" }
  EM.connect(host, port, self, *args)
end

Public Instance Methods

alive?() click to toggle source
# File lib/em-nodes/client.rb, line 14
def alive?
  @alive
end
post_init() click to toggle source
# File lib/em-nodes/client.rb, line 10
def post_init
  @alive = true
end
unbind() click to toggle source
# File lib/em-nodes/client.rb, line 18
def unbind
  @alive = false
  EM::Nodes.logger.warn { "Connection has terminated" }
end