class Dynflow::Actor::PoliteTermination

Behaviour that watches for polite asking for termination and calls corresponding method on the context to do so

Public Instance Methods

on_envelope(envelope) click to toggle source
# File lib/dynflow/actor.rb, line 19
def on_envelope(envelope)
  message, terminated_future = envelope
  if :start_termination == message
    context.start_termination(terminated_future)
    envelope.future.fulfill true if !envelope.future.nil?
    Concurrent::Actor::Behaviour::MESSAGE_PROCESSED
  else
    pass envelope
  end
end