Class: Temporalio::Workflow::Definition::Query

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

Overview

A query definition. This is usually built as a result of a workflow_query method, but can be manually created to set at runtime on Temporalio::Workflow.query_handlers.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, to_invoke:, raw_args: false) ⇒ Query

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

  • raw_args (Boolean) (defaults to: false)

    Whether the parameters should be raw values.



502
503
504
505
506
507
508
509
510
# File 'lib/temporalio/workflow/definition.rb', line 502

def initialize(
  name:,
  to_invoke:,
  raw_args: false
)
  @name = name
  @to_invoke = to_invoke
  @raw_args = raw_args
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



482
483
484
# File 'lib/temporalio/workflow/definition.rb', line 482

def name
  @name
end

#raw_argsObject (readonly)

Returns the value of attribute raw_args.



482
483
484
# File 'lib/temporalio/workflow/definition.rb', line 482

def raw_args
  @raw_args
end

#to_invokeObject (readonly)

Returns the value of attribute to_invoke.



482
483
484
# File 'lib/temporalio/workflow/definition.rb', line 482

def to_invoke
  @to_invoke
end