Class: PoolParty::Ruberl::Base
- Defined in:
- lib/poolparty/helpers/ruberl.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#port ⇒ Object
Returns the value of attribute port.
Instance Method Summary collapse
-
#initialize(host = "localhost", port = 7050) ⇒ Base
constructor
A new instance of Base.
- #messenger_cast!(msg = "force_reconfig") ⇒ Object
- #messenger_send!(msg = "get_current_load cpu") ⇒ Object
- #with_socket(&block) ⇒ Object
Constructor Details
#initialize(host = "localhost", port = 7050) ⇒ Base
Returns a new instance of Base.
6 7 8 9 |
# File 'lib/poolparty/helpers/ruberl.rb', line 6 def initialize(host="localhost", port=7050) @host = host @port = port end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
5 6 7 |
# File 'lib/poolparty/helpers/ruberl.rb', line 5 def host @host end |
#port ⇒ Object
Returns the value of attribute port.
5 6 7 |
# File 'lib/poolparty/helpers/ruberl.rb', line 5 def port @port end |
Instance Method Details
#messenger_cast!(msg = "force_reconfig") ⇒ Object
26 27 28 29 30 |
# File 'lib/poolparty/helpers/ruberl.rb', line 26 def messenger_cast!(msg="force_reconfig") with_socket do |sock| sock.send(msg, 0) end end |
#messenger_send!(msg = "get_current_load cpu") ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/poolparty/helpers/ruberl.rb', line 19 def messenger_send!(msg="get_current_load cpu") with_socket do |sock| sock.send(msg, 0) @str = sock.recv(2000) end @str end |