Class: EM::Nodes::Client
- Inherits:
-
Connection
- Object
- Connection
- EM::Nodes::Client
show all
- Includes:
- Commands, P::ObjectProtocol
- Defined in:
- lib/em-nodes/client/hello.rb,
lib/em-nodes/client/task.rb,
lib/em-nodes/client.rb
Defined Under Namespace
Modules: HelloFeature, TaskFeature
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Instance Attribute Details
#alive ⇒ Object
Returns the value of attribute alive.
8
9
10
|
# File 'lib/em-nodes/client.rb', line 8
def alive
@alive
end
|
Class Method Details
.connect(host, port = nil, *args, &block) ⇒ Object
19
20
21
22
|
# File 'lib/em-nodes/client.rb', line 19
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
|
Instance Method Details
#post_init ⇒ Object
10
11
12
|
# File 'lib/em-nodes/client.rb', line 10
def post_init
@alive = true
end
|
#unbind ⇒ Object
14
15
16
17
|
# File 'lib/em-nodes/client.rb', line 14
def unbind
@alive = false
EM::Nodes.logger.warn { "Connection has terminated" }
end
|