Class: Circus::ResourceAllocatorClient

Inherits:
Agents::Client show all
Defined in:
lib/circus/resource_allocator_client.rb

Overview

Client used to speak to resource allocation components.

Instance Method Summary collapse

Methods inherited from Agents::Client

#call

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