Class: Temporalio::Workflow::Definition::Update

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

Overview

An update definition. This is usually built as a result of a workflow_update method, but can be manually created to set at runtime on Temporalio::Workflow.update_handlers.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, to_invoke:, description: nil, raw_args: false, unfinished_policy: HandlerUnfinishedPolicy::WARN_AND_ABANDON, validator_to_invoke: nil, arg_hints: nil, result_hint: nil) ⇒ Update

Create an update definition manually. See Temporalio::Workflow::Definition.workflow_update for more details on some of the parameters.

Parameters:

  • name (String, nil)

    Name or nil if dynamic.

  • to_invoke (Symbol, Proc)

    Method name or proc to invoke.

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

    Description for this handler that may appear in CLI/UI. This is currently experimental.

  • raw_args (Boolean) (defaults to: false)

    Whether the parameters should be raw values.

  • unfinished_policy (HandlerUnfinishedPolicy) (defaults to: HandlerUnfinishedPolicy::WARN_AND_ABANDON)

    How the workflow reacts when this handler is still running on workflow completion.

  • validator_to_invoke (Symbol, Proc, nil) (defaults to: nil)

    Method name or proc validator to invoke.

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

    Argument hints for the update.

  • result_hint (Object, nil) (defaults to: nil)

    Result hints for the update.



686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
# File 'lib/temporalio/workflow/definition.rb', line 686

def initialize(
  name:,
  to_invoke:,
  description: nil,
  raw_args: false,
  unfinished_policy: HandlerUnfinishedPolicy::WARN_AND_ABANDON,
  validator_to_invoke: nil,
  arg_hints: nil,
  result_hint: nil
)
  @name = name
  @to_invoke = to_invoke
  @description = description
  @raw_args = raw_args
  @unfinished_policy = unfinished_policy
  @validator_to_invoke = validator_to_invoke
  @arg_hints = arg_hints
  @result_hint = result_hint
  Internal::ProtoUtils.assert_non_reserved_name(name)
end

Instance Attribute Details

#arg_hintsObject (readonly)

Returns the value of attribute arg_hints.



656
657
658
# File 'lib/temporalio/workflow/definition.rb', line 656

def arg_hints
  @arg_hints
end

#descriptionObject (readonly)

Returns the value of attribute description.



656
657
658
# File 'lib/temporalio/workflow/definition.rb', line 656

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



656
657
658
# File 'lib/temporalio/workflow/definition.rb', line 656

def name
  @name
end

#raw_argsObject (readonly)

Returns the value of attribute raw_args.



656
657
658
# File 'lib/temporalio/workflow/definition.rb', line 656

def raw_args
  @raw_args
end

#result_hintObject (readonly)

Returns the value of attribute result_hint.



656
657
658
# File 'lib/temporalio/workflow/definition.rb', line 656

def result_hint
  @result_hint
end

#to_invokeObject (readonly)

Returns the value of attribute to_invoke.



656
657
658
# File 'lib/temporalio/workflow/definition.rb', line 656

def to_invoke
  @to_invoke
end

#unfinished_policyObject (readonly)

Returns the value of attribute unfinished_policy.



656
657
658
# File 'lib/temporalio/workflow/definition.rb', line 656

def unfinished_policy
  @unfinished_policy
end

#validator_to_invokeObject (readonly)

Returns the value of attribute validator_to_invoke.



656
657
658
# File 'lib/temporalio/workflow/definition.rb', line 656

def validator_to_invoke
  @validator_to_invoke
end