Class: KnuckleCluster::TaskRegistry

Inherits:
Object
  • Object
show all
Defined in:
lib/knuckle_cluster/task_registry.rb

Instance Method Summary collapse

Constructor Details

#initialize(ecs_client:, cluster_name:, agent_registry:) ⇒ TaskRegistry



6
7
8
9
10
# File 'lib/knuckle_cluster/task_registry.rb', line 6

def initialize(ecs_client:, cluster_name:, agent_registry:)
  @ecs_client = ecs_client
  @cluster_name = cluster_name
  @agent_registry = agent_registry
end

Instance Method Details

#containersObject



16
17
18
# File 'lib/knuckle_cluster/task_registry.rb', line 16

def containers
  tasks && all_containers
end

#containers_where(task:) ⇒ Object



24
25
26
# File 'lib/knuckle_cluster/task_registry.rb', line 24

def containers_where(task:)
  containers_by_task[task]
end

#tasksObject



12
13
14
# File 'lib/knuckle_cluster/task_registry.rb', line 12

def tasks
  @tasks ||= load_tasks
end

#where(container_instance_arn:) ⇒ Object



20
21
22
# File 'lib/knuckle_cluster/task_registry.rb', line 20

def where(container_instance_arn:)
  tasks_by_container_instance_arn[container_instance_arn]
end