Class: Circus::ResourceAllocatorClient
- Inherits:
-
Agents::Client
- Object
- Agents::Client
- Circus::ResourceAllocatorClient
- Defined in:
- lib/circus/resource_allocator_client.rb
Overview
Client used to speak to resource allocation components.
Instance Method Summary collapse
- #allocate(allocator, spec) ⇒ Object
-
#initialize(connection, logger, allocator_obj) ⇒ ResourceAllocatorClient
constructor
A new instance of ResourceAllocatorClient.
Methods inherited from Agents::Client
Constructor Details
#initialize(connection, logger, allocator_obj) ⇒ ResourceAllocatorClient
Returns a new instance of ResourceAllocatorClient.
8 9 10 11 12 13 |
# File 'lib/circus/resource_allocator_client.rb', line 8 def initialize(connection, logger, allocator_obj) super(connection) @logger = logger @allocator_obj = allocator_obj end |
Instance Method Details
#allocate(allocator, spec) ⇒ Object
15 16 17 |
# File 'lib/circus/resource_allocator_client.rb', line 15 def allocate(allocator, spec) @connection.call(allocator, @allocator_obj, 'ResourceAllocator', 'allocate', {'spec' => spec.to_json}, @logger) end |