Class: Temporal::Configuration
- Inherits:
-
Object
- Object
- Temporal::Configuration
- Defined in:
- lib/temporal/configuration.rb
Constant Summary collapse
- DEFAULT_TIMEOUTS =
We want an infinite execution timeout for cron schedules and other perpetual workflows. We choose an 10-year execution timeout because that’s the maximum the cassandra DB supports, matching the go SDK, see github.com/temporalio/sdk-go/blob/d96130dad3d2bc189bc7626543bd5911cc07ff6d/internal/internal_workflow_testsuite.go#L68
{ execution: 86_400 * 365 * 10, # End-to-end workflow time, including all recurrences if it's scheduled. # Time for a single run, excluding retries. Server defaults to execution timeout; we default here as well to be explicit. run: 86_400 * 365 * 10, task: 10, # Workflow task processing time schedule_to_close: nil, # End-to-end activity time (default: schedule_to_start + start_to_close) schedule_to_start: 10, # Queue time for an activity start_to_close: 30, # Time spent processing an activity heartbeat: nil # Max time between heartbeats (off by default) }.freeze
- DEFAULT_HEADERS =
{}.freeze
- DEFAULT_NAMESPACE =
'default-namespace'.freeze
- DEFAULT_TASK_QUEUE =
'default-task-queue'.freeze
- DEFAULT_CONVERTER =
Temporal::Client::Converter::Composite.new( payload_converters: [ Temporal::Client::Converter::Payload::Nil.new, Temporal::Client::Converter::Payload::Bytes.new, Temporal::Client::Converter::Payload::JSON.new, ] ).freeze
Instance Attribute Summary collapse
-
#client_type ⇒ Object
Returns the value of attribute client_type.
- #converter ⇒ Object
-
#error_handlers ⇒ Object
readonly
Returns the value of attribute error_handlers.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#host ⇒ Object
Returns the value of attribute host.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#metrics_adapter ⇒ Object
Returns the value of attribute metrics_adapter.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#port ⇒ Object
Returns the value of attribute port.
-
#task_queue ⇒ Object
Returns the value of attribute task_queue.
-
#timeouts ⇒ Object
Returns the value of attribute timeouts.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #on_error(&block) ⇒ Object
- #task_list ⇒ Object
- #task_list=(name) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/temporal/configuration.rb', line 39 def initialize @client_type = :grpc @logger = Temporal::Logger.new(STDOUT, progname: 'temporal_client') @metrics_adapter = MetricsAdapters::Null.new @timeouts = DEFAULT_TIMEOUTS @namespace = DEFAULT_NAMESPACE @task_queue = DEFAULT_TASK_QUEUE @headers = DEFAULT_HEADERS @converter = DEFAULT_CONVERTER @error_handlers = [] end |
Instance Attribute Details
#client_type ⇒ Object
Returns the value of attribute client_type.
12 13 14 |
# File 'lib/temporal/configuration.rb', line 12 def client_type @client_type end |
#converter ⇒ Object
67 68 69 |
# File 'lib/temporal/configuration.rb', line 67 def converter @converter end |
#error_handlers ⇒ Object (readonly)
Returns the value of attribute error_handlers.
10 11 12 |
# File 'lib/temporal/configuration.rb', line 10 def error_handlers @error_handlers end |
#headers ⇒ Object
Returns the value of attribute headers.
12 13 14 |
# File 'lib/temporal/configuration.rb', line 12 def headers @headers end |
#host ⇒ Object
Returns the value of attribute host.
12 13 14 |
# File 'lib/temporal/configuration.rb', line 12 def host @host end |
#logger ⇒ Object
Returns the value of attribute logger.
12 13 14 |
# File 'lib/temporal/configuration.rb', line 12 def logger @logger end |
#metrics_adapter ⇒ Object
Returns the value of attribute metrics_adapter.
12 13 14 |
# File 'lib/temporal/configuration.rb', line 12 def metrics_adapter @metrics_adapter end |
#namespace ⇒ Object
Returns the value of attribute namespace.
12 13 14 |
# File 'lib/temporal/configuration.rb', line 12 def namespace @namespace end |
#port ⇒ Object
Returns the value of attribute port.
12 13 14 |
# File 'lib/temporal/configuration.rb', line 12 def port @port end |
#task_queue ⇒ Object
Returns the value of attribute task_queue.
12 13 14 |
# File 'lib/temporal/configuration.rb', line 12 def task_queue @task_queue end |
#timeouts ⇒ Object
Returns the value of attribute timeouts.
10 11 12 |
# File 'lib/temporal/configuration.rb', line 10 def timeouts @timeouts end |
Instance Method Details
#on_error(&block) ⇒ Object
51 52 53 |
# File 'lib/temporal/configuration.rb', line 51 def on_error(&block) @error_handlers << block end |
#task_list ⇒ Object
55 56 57 |
# File 'lib/temporal/configuration.rb', line 55 def task_list @task_queue end |
#task_list=(name) ⇒ Object
59 60 61 |
# File 'lib/temporal/configuration.rb', line 59 def task_list=(name) self.task_queue = name end |