Exception: Temporalio::Workflow::ContinueAsNewError

Inherits:
Error
  • Object
show all
Defined in:
lib/temporalio/workflow.rb

Overview

Error that is raised by a workflow out of the primary workflow method to issue a continue-as-new.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Error

canceled?

Constructor Details

#initialize(*args, workflow: nil, task_queue: nil, run_timeout: nil, task_timeout: nil, backoff_start_interval: nil, retry_policy: nil, memo: nil, search_attributes: nil, arg_hints: nil, headers: {}, initial_versioning_behavior: nil) ⇒ ContinueAsNewError

Create a continue as new error.

Parameters:

  • args (Array<Object>)

    Arguments for the new workflow.

  • workflow (Class<Workflow::Definition>, String, Symbol, nil) (defaults to: nil)

    Workflow definition class or workflow name. If unset/nil, the current workflow is used.

  • task_queue (String, nil) (defaults to: nil)

    Task queue for the workflow. If unset/nil, the current workflow task queue is used.

  • run_timeout (Float, nil) (defaults to: nil)

    Timeout of a single workflow run in seconds. The default is not carried over from the current workflow.

  • task_timeout (Float, nil) (defaults to: nil)

    Timeout of a single workflow task in seconds. The default is not carried over from the current workflow.

  • backoff_start_interval (Float, nil) (defaults to: nil)

    Delay before the first workflow task of the continued run is scheduled.

  • retry_policy (RetryPolicy, nil) (defaults to: nil)

    Retry policy for the workflow. If unset/nil, the current workflow retry policy is used.

  • memo (Hash{String, Symbol => Object}, nil) (defaults to: nil)

    Memo for the workflow. If unset/nil, the current workflow memo is used.

  • search_attributes (SearchAttributes, nil) (defaults to: nil)

    Search attributes for the workflow. If unset/nil, the current workflow search attributes are used.

  • arg_hints (Array<Object>, nil) (defaults to: nil)

    Overrides converter hints for arguments if any. If unset/nil and the workflow definition has arg hints, those are used by default.

  • headers (Hash<String, Object>) (defaults to: {})

    Headers for the workflow. The default is not carried over from the current workflow.

  • initial_versioning_behavior (ContinueAsNewVersioningBehavior::enum, nil) (defaults to: nil)

    Versioning behavior for the first task of the new run. Set to ContinueAsNewVersioningBehavior::AUTO_UPGRADE to upgrade a pinned workflow to the latest version on continue-as-new or ContinueAsNewVersioningBehavior::USE_RAMPING_VERSION to start on the task queue's Ramping Version. This is currently experimental.



683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
# File 'lib/temporalio/workflow.rb', line 683

def initialize(
  *args,
  workflow: nil,
  task_queue: nil,
  run_timeout: nil,
  task_timeout: nil,
  backoff_start_interval: nil,
  retry_policy: nil,
  memo: nil,
  search_attributes: nil,
  arg_hints: nil,
  headers: {},
  initial_versioning_behavior: nil
)
  super('Continue as new')
  @args = args
  @workflow = workflow
  @task_queue = task_queue
  @run_timeout = run_timeout
  @task_timeout = task_timeout
  @backoff_start_interval = backoff_start_interval
  @retry_policy = retry_policy
  @memo = memo
  @search_attributes = search_attributes
  @arg_hints = arg_hints
  @headers = headers
  @initial_versioning_behavior = initial_versioning_behavior
  Workflow._current.initialize_continue_as_new_error(self)
end

Instance Attribute Details

#arg_hintsObject

Returns the value of attribute arg_hints.



651
652
653
# File 'lib/temporalio/workflow.rb', line 651

def arg_hints
  @arg_hints
end

#argsObject

Returns the value of attribute args.



651
652
653
# File 'lib/temporalio/workflow.rb', line 651

def args
  @args
end

#backoff_start_intervalObject

Returns the value of attribute backoff_start_interval.



651
652
653
# File 'lib/temporalio/workflow.rb', line 651

def backoff_start_interval
  @backoff_start_interval
end

#headersObject

Returns the value of attribute headers.



651
652
653
# File 'lib/temporalio/workflow.rb', line 651

def headers
  @headers
end

#initial_versioning_behaviorObject

Returns the value of attribute initial_versioning_behavior.



651
652
653
# File 'lib/temporalio/workflow.rb', line 651

def initial_versioning_behavior
  @initial_versioning_behavior
end

#memoObject

Returns the value of attribute memo.



651
652
653
# File 'lib/temporalio/workflow.rb', line 651

def memo
  @memo
end

#retry_policyObject

Returns the value of attribute retry_policy.



651
652
653
# File 'lib/temporalio/workflow.rb', line 651

def retry_policy
  @retry_policy
end

#run_timeoutObject

Returns the value of attribute run_timeout.



651
652
653
# File 'lib/temporalio/workflow.rb', line 651

def run_timeout
  @run_timeout
end

#search_attributesObject

Returns the value of attribute search_attributes.



651
652
653
# File 'lib/temporalio/workflow.rb', line 651

def search_attributes
  @search_attributes
end

#task_queueObject

Returns the value of attribute task_queue.



651
652
653
# File 'lib/temporalio/workflow.rb', line 651

def task_queue
  @task_queue
end

#task_timeoutObject

Returns the value of attribute task_timeout.



651
652
653
# File 'lib/temporalio/workflow.rb', line 651

def task_timeout
  @task_timeout
end

#workflowObject

Returns the value of attribute workflow.



651
652
653
# File 'lib/temporalio/workflow.rb', line 651

def workflow
  @workflow
end