Class: KillTaskContainer

Inherits:
Object
  • Object
show all
Defined in:
app/services/kill_task_container.rb

Defined Under Namespace

Classes: TaskNotRunningError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(task:) ⇒ KillTaskContainer

Returns a new instance of KillTaskContainer.



10
11
12
# File 'app/services/kill_task_container.rb', line 10

def initialize(task:)
  @task = task
end

Instance Attribute Details

#taskObject (readonly)

Returns the value of attribute task.



4
5
6
# File 'app/services/kill_task_container.rb', line 4

def task
  @task
end

Instance Method Details

#performObject



14
15
16
17
18
19
20
21
22
# File 'app/services/kill_task_container.rb', line 14

def perform
  validate_task_status

  task
    .slot
    .node
    .runner_service(:kill_slot_runner)
    .perform(slot: task.slot)
end