Module: Dynflow::Executors::RemoteViaSocket::Core::TrackedJob

Defined in:
lib/dynflow/executors/remote_via_socket/core.rb

Instance Method Summary collapse

Instance Method Details

#accept!Object



24
25
26
27
# File 'lib/dynflow/executors/remote_via_socket/core.rb', line 24

def accept!
  accepted.resolve true
  self
end

#fail!(error) ⇒ Object



48
49
50
51
52
53
54
55
# File 'lib/dynflow/executors/remote_via_socket/core.rb', line 48

def fail!(error)
  if accepted.ready?
    finished.fail error
  else
    reject! error
  end
  self
end

#reject!(error) ⇒ Object



29
30
31
32
33
# File 'lib/dynflow/executors/remote_via_socket/core.rb', line 29

def reject!(error)
  accepted.fail error
  finished.fail error
  self
end

#success!(world) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/dynflow/executors/remote_via_socket/core.rb', line 35

def success!(world)
  raise unless accepted.ready?
  finished.resolve(
      match job,
            (on Core::Protocol::Execution.(execution_plan_id: ~any) do |uuid|
              world.persistence.load_execution_plan(uuid)
            end),
            (on Core::Protocol::Event do
              true
            end))
  self
end