Class: GenevaDrive::ResumableStepDefinition Private
- Inherits:
-
StepDefinition
- Object
- StepDefinition
- GenevaDrive::ResumableStepDefinition
- Defined in:
- lib/geneva_drive/resumable_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.
Metadata about a resumable step definition in a workflow. Extends StepDefinition with cursor-based iteration support.
Resumable steps can iterate over large collections with checkpointing, allowing them to be suspended and resumed across job executions.
Instance Attribute Summary collapse
-
#block ⇒ Proc
readonly
private
The block to execute (receives IterableStep).
-
#max_iterations ⇒ Integer?
readonly
private
Maximum number of iterations before auto-suspend.
-
#max_runtime ⇒ ActiveSupport::Duration?
readonly
private
Maximum runtime before auto-suspend.
Instance Method Summary collapse
-
#execute_in_context(workflow, iterable_step) ⇒ Object
private
Executes the step block with an IterableStep in the workflow context.
-
#initialize(name:, max_iterations: nil, max_runtime: nil, **options, &block) ⇒ ResumableStepDefinition
constructor
private
Creates a new resumable step definition.
-
#resumable? ⇒ Boolean
private
Returns true to indicate this step supports resumable iteration.
Constructor Details
#initialize(name:, max_iterations: nil, max_runtime: nil, **options, &block) ⇒ ResumableStepDefinition
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 new resumable step definition.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/geneva_drive/resumable_step_definition.rb', line 28 def initialize(name:, max_iterations: nil, max_runtime: nil, **, &block) @block = block @max_iterations = max_iterations @max_runtime = max_runtime # Pass a dummy callable to parent since we use block instead super(name: name, callable: block, **) validate_resumable! end |
Instance Attribute Details
#block ⇒ Proc (readonly)
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 the block to execute (receives IterableStep).
12 13 14 |
# File 'lib/geneva_drive/resumable_step_definition.rb', line 12 def block @block end |
#max_iterations ⇒ Integer? (readonly)
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 maximum number of iterations before auto-suspend.
15 16 17 |
# File 'lib/geneva_drive/resumable_step_definition.rb', line 15 def max_iterations @max_iterations end |
#max_runtime ⇒ ActiveSupport::Duration? (readonly)
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 maximum runtime before auto-suspend.
18 19 20 |
# File 'lib/geneva_drive/resumable_step_definition.rb', line 18 def max_runtime @max_runtime end |
Instance Method Details
#execute_in_context(workflow, iterable_step) ⇒ Object
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.
Executes the step block with an IterableStep in the workflow context.
51 52 53 |
# File 'lib/geneva_drive/resumable_step_definition.rb', line 51 def execute_in_context(workflow, iterable_step) workflow.instance_exec(iterable_step, &@block) end |
#resumable? ⇒ 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 indicate this step supports resumable iteration.
42 43 44 |
# File 'lib/geneva_drive/resumable_step_definition.rb', line 42 def resumable? true end |