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
20
21
22
|
# File 'lib/em-nodes/client.rb', line 20
def self.connect(host, port = nil, *args, &block)
EM.connect(host, port, self, *args)
end
|
Instance Method Details
#post_init ⇒ Object
10
11
12
13
|
# File 'lib/em-nodes/client.rb', line 10
def post_init
@alive = true
EM::Nodes.logger.info { "Connected to server" }
end
|
#unbind ⇒ Object
15
16
17
18
|
# File 'lib/em-nodes/client.rb', line 15
def unbind
@alive = false
EM::Nodes.logger.warn { "Connection has terminated" }
end
|