Class: Temporalio::Workflow::Definition::Signal

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

Overview

A signal definition. This is usually built as a result of a workflow_signal method, but can be manually created to set at runtime on Temporalio::Workflow.signal_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, arg_hints: nil) ⇒ Signal

Create a signal definition manually. See Temporalio::Workflow::Definition.workflow_signal 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.

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

    Argument hints for the signal.



588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
# File 'lib/temporalio/workflow/definition.rb', line 588

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

Instance Attribute Details

#arg_hintsObject (readonly)

Returns the value of attribute arg_hints.



561
562
563
# File 'lib/temporalio/workflow/definition.rb', line 561

def arg_hints
  @arg_hints
end

#descriptionObject (readonly)

Returns the value of attribute description.



561
562
563
# File 'lib/temporalio/workflow/definition.rb', line 561

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



561
562
563
# File 'lib/temporalio/workflow/definition.rb', line 561

def name
  @name
end

#raw_argsObject (readonly)

Returns the value of attribute raw_args.



561
562
563
# File 'lib/temporalio/workflow/definition.rb', line 561

def raw_args
  @raw_args
end

#to_invokeObject (readonly)

Returns the value of attribute to_invoke.



561
562
563
# File 'lib/temporalio/workflow/definition.rb', line 561

def to_invoke
  @to_invoke
end

#unfinished_policyObject (readonly)

Returns the value of attribute unfinished_policy.



561
562
563
# File 'lib/temporalio/workflow/definition.rb', line 561

def unfinished_policy
  @unfinished_policy
end