Class: Iodized::Client
- Inherits:
-
Object
- Object
- Iodized::Client
- Defined in:
- lib/iodized/client.rb
Instance Method Summary collapse
- #close ⇒ Object
- #feature_set(state) ⇒ Object
-
#initialize(host = 'localhost', port = 5353) ⇒ Client
constructor
A new instance of Client.
- #ping ⇒ Object
Constructor Details
#initialize(host = 'localhost', port = 5353) ⇒ Client
Returns a new instance of Client.
6 7 8 9 |
# File 'lib/iodized/client.rb', line 6 def initialize(host='localhost', port=5353) @host = host @port = port end |
Instance Method Details
#close ⇒ Object
11 12 13 |
# File 'lib/iodized/client.rb', line 11 def close @transport.close end |
#feature_set(state) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/iodized/client.rb', line 19 def feature_set(state) retries = 5 begin thrift_client.feature_set(state.merge(request_state)) rescue Thrift::TransportException => e if (retries -= 1) > 0 retry else raise e end end end |
#ping ⇒ Object
15 16 17 |
# File 'lib/iodized/client.rb', line 15 def ping() thrift_client.ping end |