Class: Temporal::ExecutionOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/temporal/execution_options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, options = {}) ⇒ ExecutionOptions

Returns a new instance of ExecutionOptions.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/temporal/execution_options.rb', line 7

def initialize(object, options = {})
  @name = options[:name] || object.to_s
  @namespace = options[:namespace]
  @task_queue = options[:task_queue] || options[:task_list]
  @retry_policy = options[:retry_policy]
  @timeouts = options[:timeouts] || {}
  @headers = options[:headers] || {}

  if has_executable_concern?(object)
    @namespace ||= object.namespace
    @task_queue ||= object.task_queue
    @retry_policy ||= object.retry_policy
    @timeouts = object.timeouts.merge(@timeouts) if object.timeouts
    @headers = object.headers.merge(@headers) if object.headers
  end

  @namespace ||= Temporal.configuration.namespace
  @task_queue ||= Temporal.configuration.task_queue
  @timeouts = Temporal.configuration.timeouts.merge(@timeouts)
  @headers = Temporal.configuration.headers.merge(@headers)

  freeze
end

Instance Attribute Details

#headersObject (readonly)

Returns the value of attribute headers.



5
6
7
# File 'lib/temporal/execution_options.rb', line 5

def headers
  @headers
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/temporal/execution_options.rb', line 5

def name
  @name
end

#namespaceObject (readonly)

Returns the value of attribute namespace.



5
6
7
# File 'lib/temporal/execution_options.rb', line 5

def namespace
  @namespace
end

#retry_policyObject (readonly)

Returns the value of attribute retry_policy.



5
6
7
# File 'lib/temporal/execution_options.rb', line 5

def retry_policy
  @retry_policy
end

#task_queueObject (readonly)

Returns the value of attribute task_queue.



5
6
7
# File 'lib/temporal/execution_options.rb', line 5

def task_queue
  @task_queue
end

#timeoutsObject (readonly)

Returns the value of attribute timeouts.



5
6
7
# File 'lib/temporal/execution_options.rb', line 5

def timeouts
  @timeouts
end

Instance Method Details

#task_listObject



31
32
33
# File 'lib/temporal/execution_options.rb', line 31

def task_list
  @task_queue
end