Class: Miu::Nodes::Sana::Node
- Inherits:
-
Object
- Object
- Miu::Nodes::Sana::Node
- Includes:
- Miu::Node
- Defined in:
- lib/miu/nodes/sana/node.rb
Constant Summary collapse
- DEFAULT_PORT =
Miu.default_port + 37
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
-
#subscriber ⇒ Object
readonly
Returns the value of attribute subscriber.
Instance Method Summary collapse
-
#initialize(options) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(options) ⇒ Node
Returns a new instance of Node.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/miu/nodes/sana/node.rb', line 20 def initialize() @options = Miu::Logger.info "Options:" @options.each do |k, v| Miu::Logger.info " #{k}: #{v}" end establish [:database] @server = Server.new [:bind], [:port] @subscriber = Subscriber.new ['sub-host'], ['sub-port'], ['sub-tag'] @subscriber.async.run [:INT, :TERM].each do |sig| trap(sig) { exit } end sleep end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
18 19 20 |
# File 'lib/miu/nodes/sana/node.rb', line 18 def @options end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
17 18 19 |
# File 'lib/miu/nodes/sana/node.rb', line 17 def server @server end |
#subscriber ⇒ Object (readonly)
Returns the value of attribute subscriber.
17 18 19 |
# File 'lib/miu/nodes/sana/node.rb', line 17 def subscriber @subscriber end |