Class: Waterfall::Client
- Inherits:
-
Object
- Object
- Waterfall::Client
- Defined in:
- lib/waterfall/client.rb
Defined Under Namespace
Classes: ClientWrapper
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #next_id ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
7 8 9 10 |
# File 'lib/waterfall/client.rb', line 7 def initialize( = {}) settings = {host: 'localhost', port: 5290}.merge() @pool = ConnectionPool.new { ClientWrapper.new(settings) } end |
Instance Method Details
#close ⇒ Object
19 20 21 |
# File 'lib/waterfall/client.rb', line 19 def close @pool.shutdown { |client| client.close } end |
#next_id ⇒ Object
12 13 14 15 16 |
# File 'lib/waterfall/client.rb', line 12 def next_id @pool.with do |client| client.next_id end end |