Class: GenevaDrive::RemovedStepDefinition Private

Inherits:
StepDefinition
  • Object
show all
Defined in:
lib/geneva_drive/removed_step_definition.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A gravestone left in place of a step that has been taken out of a workflow.

Deleting a step outright is not safe while workflows are in flight: an execution row already scheduled for that name finds no definition when its job runs, and the workflow pauses with StepNotDefinedError. Declaring removed_step :name in the position the step used to occupy keeps the name resolvable, so those executions are skipped instead of stranding the workflow, while scheduling never spools a new execution for it again.

A removed step holds nothing but a name - no block, no wait, no conditions. There is nothing left to configure about a step that does not run.

Instance Method Summary collapse

Constructor Details

#initialize(name:, call_location: nil) ⇒ RemovedStepDefinition

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Creates a gravestone for a step that no longer exists.

The parent is handed a callable that never runs: a removed step is intercepted by the executor before it would be performed.

Parameters:

  • name (String, Symbol) —

    the name of the step that was removed

  • call_location (Array<String, Integer>, nil) (defaults to: nil) —

    source location of the removed_step call



24
25
26
# File 'lib/geneva_drive/removed_step_definition.rb', line 24

def initialize(name:, call_location: nil)
  super(name: name, callable: :__removed_step_never_runs, call_location: call_location)
end

Instance Method Details

#removed? ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns true to mark this as a gravestone rather than a runnable step.

Returns:

  • (Boolean)


31
32
33
# File 'lib/geneva_drive/removed_step_definition.rb', line 31

def removed?
  true
end