temporalio 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +2 -0
- data/Cargo.lock +980 -583
- data/Cargo.toml +2 -2
- data/Gemfile +7 -3
- data/README.md +769 -54
- data/Rakefile +10 -296
- data/ext/Cargo.toml +2 -0
- data/lib/temporalio/activity/complete_async_error.rb +1 -1
- data/lib/temporalio/activity/context.rb +18 -2
- data/lib/temporalio/activity/definition.rb +180 -65
- data/lib/temporalio/activity/info.rb +25 -21
- data/lib/temporalio/activity.rb +2 -59
- data/lib/temporalio/api/activity/v1/message.rb +25 -0
- data/lib/temporalio/api/batch/v1/message.rb +6 -1
- data/lib/temporalio/api/cloud/account/v1/message.rb +28 -0
- data/lib/temporalio/api/cloud/cloudservice/v1/request_response.rb +34 -1
- data/lib/temporalio/api/cloud/cloudservice/v1/service.rb +1 -1
- data/lib/temporalio/api/cloud/identity/v1/message.rb +6 -1
- data/lib/temporalio/api/cloud/namespace/v1/message.rb +8 -1
- data/lib/temporalio/api/cloud/nexus/v1/message.rb +31 -0
- data/lib/temporalio/api/cloud/operation/v1/message.rb +2 -1
- data/lib/temporalio/api/cloud/region/v1/message.rb +2 -1
- data/lib/temporalio/api/cloud/resource/v1/message.rb +23 -0
- data/lib/temporalio/api/cloud/sink/v1/message.rb +24 -0
- data/lib/temporalio/api/cloud/usage/v1/message.rb +31 -0
- data/lib/temporalio/api/command/v1/message.rb +1 -1
- data/lib/temporalio/api/common/v1/message.rb +8 -1
- data/lib/temporalio/api/deployment/v1/message.rb +38 -0
- data/lib/temporalio/api/enums/v1/batch_operation.rb +1 -1
- data/lib/temporalio/api/enums/v1/common.rb +1 -1
- data/lib/temporalio/api/enums/v1/deployment.rb +23 -0
- data/lib/temporalio/api/enums/v1/event_type.rb +1 -1
- data/lib/temporalio/api/enums/v1/failed_cause.rb +1 -1
- data/lib/temporalio/api/enums/v1/nexus.rb +21 -0
- data/lib/temporalio/api/enums/v1/reset.rb +1 -1
- data/lib/temporalio/api/enums/v1/workflow.rb +2 -1
- data/lib/temporalio/api/errordetails/v1/message.rb +3 -1
- data/lib/temporalio/api/failure/v1/message.rb +3 -1
- data/lib/temporalio/api/history/v1/message.rb +3 -1
- data/lib/temporalio/api/nexus/v1/message.rb +3 -2
- data/lib/temporalio/api/operatorservice/v1/service.rb +1 -1
- data/lib/temporalio/api/payload_visitor.rb +1581 -0
- data/lib/temporalio/api/query/v1/message.rb +2 -1
- data/lib/temporalio/api/schedule/v1/message.rb +2 -1
- data/lib/temporalio/api/taskqueue/v1/message.rb +4 -1
- data/lib/temporalio/api/testservice/v1/request_response.rb +31 -0
- data/lib/temporalio/api/testservice/v1/service.rb +23 -0
- data/lib/temporalio/api/workflow/v1/message.rb +9 -1
- data/lib/temporalio/api/workflowservice/v1/request_response.rb +46 -2
- data/lib/temporalio/api/workflowservice/v1/service.rb +1 -1
- data/lib/temporalio/api.rb +2 -0
- data/lib/temporalio/cancellation.rb +34 -14
- data/lib/temporalio/client/async_activity_handle.rb +12 -37
- data/lib/temporalio/client/connection/cloud_service.rb +309 -231
- data/lib/temporalio/client/connection/operator_service.rb +36 -84
- data/lib/temporalio/client/connection/service.rb +6 -5
- data/lib/temporalio/client/connection/test_service.rb +111 -0
- data/lib/temporalio/client/connection/workflow_service.rb +474 -441
- data/lib/temporalio/client/connection.rb +90 -44
- data/lib/temporalio/client/interceptor.rb +199 -60
- data/lib/temporalio/client/schedule.rb +991 -0
- data/lib/temporalio/client/schedule_handle.rb +126 -0
- data/lib/temporalio/client/with_start_workflow_operation.rb +115 -0
- data/lib/temporalio/client/workflow_execution.rb +26 -10
- data/lib/temporalio/client/workflow_handle.rb +41 -98
- data/lib/temporalio/client/workflow_update_handle.rb +3 -5
- data/lib/temporalio/client.rb +247 -44
- data/lib/temporalio/common_enums.rb +17 -0
- data/lib/temporalio/contrib/open_telemetry.rb +470 -0
- data/lib/temporalio/converters/data_converter.rb +4 -7
- data/lib/temporalio/converters/failure_converter.rb +5 -3
- data/lib/temporalio/converters/payload_converter/composite.rb +4 -0
- data/lib/temporalio/converters/payload_converter.rb +6 -8
- data/lib/temporalio/converters/raw_value.rb +20 -0
- data/lib/temporalio/error/failure.rb +1 -1
- data/lib/temporalio/error.rb +11 -2
- data/lib/temporalio/internal/bridge/api/activity_task/activity_task.rb +1 -1
- data/lib/temporalio/internal/bridge/api/common/common.rb +2 -1
- data/lib/temporalio/internal/bridge/api/core_interface.rb +5 -1
- data/lib/temporalio/internal/bridge/api/nexus/nexus.rb +33 -0
- data/lib/temporalio/internal/bridge/api/workflow_activation/workflow_activation.rb +5 -1
- data/lib/temporalio/internal/bridge/api/workflow_commands/workflow_commands.rb +4 -1
- data/lib/temporalio/internal/bridge/api/workflow_completion/workflow_completion.rb +2 -1
- data/lib/temporalio/internal/bridge/client.rb +11 -6
- data/lib/temporalio/internal/bridge/runtime.rb +3 -0
- data/lib/temporalio/internal/bridge/testing.rb +23 -0
- data/lib/temporalio/internal/bridge/worker.rb +2 -0
- data/lib/temporalio/internal/bridge.rb +1 -1
- data/lib/temporalio/internal/client/implementation.rb +468 -71
- data/lib/temporalio/internal/metric.rb +122 -0
- data/lib/temporalio/internal/proto_utils.rb +118 -7
- data/lib/temporalio/internal/worker/activity_worker.rb +69 -29
- data/lib/temporalio/internal/worker/multi_runner.rb +53 -9
- data/lib/temporalio/internal/worker/workflow_instance/child_workflow_handle.rb +54 -0
- data/lib/temporalio/internal/worker/workflow_instance/context.rb +383 -0
- data/lib/temporalio/internal/worker/workflow_instance/details.rb +46 -0
- data/lib/temporalio/internal/worker/workflow_instance/external_workflow_handle.rb +32 -0
- data/lib/temporalio/internal/worker/workflow_instance/externally_immutable_hash.rb +22 -0
- data/lib/temporalio/internal/worker/workflow_instance/handler_execution.rb +25 -0
- data/lib/temporalio/internal/worker/workflow_instance/handler_hash.rb +41 -0
- data/lib/temporalio/internal/worker/workflow_instance/illegal_call_tracer.rb +97 -0
- data/lib/temporalio/internal/worker/workflow_instance/inbound_implementation.rb +62 -0
- data/lib/temporalio/internal/worker/workflow_instance/outbound_implementation.rb +400 -0
- data/lib/temporalio/internal/worker/workflow_instance/replay_safe_logger.rb +37 -0
- data/lib/temporalio/internal/worker/workflow_instance/replay_safe_metric.rb +40 -0
- data/lib/temporalio/internal/worker/workflow_instance/scheduler.rb +183 -0
- data/lib/temporalio/internal/worker/workflow_instance.rb +774 -0
- data/lib/temporalio/internal/worker/workflow_worker.rb +239 -0
- data/lib/temporalio/metric.rb +109 -0
- data/lib/temporalio/retry_policy.rb +37 -14
- data/lib/temporalio/runtime/metric_buffer.rb +94 -0
- data/lib/temporalio/runtime.rb +160 -79
- data/lib/temporalio/search_attributes.rb +93 -37
- data/lib/temporalio/testing/activity_environment.rb +44 -16
- data/lib/temporalio/testing/workflow_environment.rb +276 -7
- data/lib/temporalio/version.rb +1 -1
- data/lib/temporalio/worker/activity_executor/thread_pool.rb +9 -217
- data/lib/temporalio/worker/activity_executor.rb +3 -3
- data/lib/temporalio/worker/interceptor.rb +343 -66
- data/lib/temporalio/worker/thread_pool.rb +237 -0
- data/lib/temporalio/worker/tuner.rb +38 -0
- data/lib/temporalio/worker/workflow_executor/thread_pool.rb +235 -0
- data/lib/temporalio/worker/workflow_executor.rb +26 -0
- data/lib/temporalio/worker/workflow_replayer.rb +350 -0
- data/lib/temporalio/worker.rb +235 -58
- data/lib/temporalio/workflow/activity_cancellation_type.rb +20 -0
- data/lib/temporalio/workflow/child_workflow_cancellation_type.rb +21 -0
- data/lib/temporalio/workflow/child_workflow_handle.rb +43 -0
- data/lib/temporalio/workflow/definition.rb +598 -0
- data/lib/temporalio/workflow/external_workflow_handle.rb +41 -0
- data/lib/temporalio/workflow/future.rb +151 -0
- data/lib/temporalio/workflow/handler_unfinished_policy.rb +13 -0
- data/lib/temporalio/workflow/info.rb +104 -0
- data/lib/temporalio/workflow/parent_close_policy.rb +19 -0
- data/lib/temporalio/workflow/update_info.rb +20 -0
- data/lib/temporalio/workflow.rb +575 -0
- data/lib/temporalio/workflow_history.rb +26 -1
- data/lib/temporalio.rb +4 -0
- data/temporalio.gemspec +4 -3
- metadata +73 -10
@@ -14,8 +14,7 @@ module Temporalio
|
|
14
14
|
# Connection to Temporal server that is not namespace specific. Most users will use {Client.connect} instead of this
|
15
15
|
# directly.
|
16
16
|
class Connection
|
17
|
-
|
18
|
-
Options = Struct.new(
|
17
|
+
Options = Data.define(
|
19
18
|
:target_host,
|
20
19
|
:api_key,
|
21
20
|
:tls,
|
@@ -25,8 +24,17 @@ module Temporalio
|
|
25
24
|
:keep_alive,
|
26
25
|
:http_connect_proxy,
|
27
26
|
:runtime,
|
28
|
-
:lazy_connect
|
29
|
-
|
27
|
+
:lazy_connect
|
28
|
+
)
|
29
|
+
|
30
|
+
# Options as returned from {options} for +**to_h+ splat use in {initialize}. See {initialize} for details.
|
31
|
+
class Options; end # rubocop:disable Lint/EmptyClass
|
32
|
+
|
33
|
+
TLSOptions = Data.define(
|
34
|
+
:client_cert,
|
35
|
+
:client_private_key,
|
36
|
+
:server_root_ca_cert,
|
37
|
+
:domain
|
30
38
|
)
|
31
39
|
|
32
40
|
# TLS options. All attributes are optional, and an empty options set just enables default TLS.
|
@@ -41,12 +49,24 @@ module Temporalio
|
|
41
49
|
# @!attribute domain
|
42
50
|
# @return [String, nil] SNI override. This is only needed for self-hosted servers with certificates that do not
|
43
51
|
# match the hostname being connected to.
|
44
|
-
TLSOptions
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
52
|
+
class TLSOptions
|
53
|
+
def initialize(
|
54
|
+
client_cert: nil,
|
55
|
+
client_private_key: nil,
|
56
|
+
server_root_ca_cert: nil,
|
57
|
+
domain: nil
|
58
|
+
)
|
59
|
+
super
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
RPCRetryOptions = Data.define(
|
64
|
+
:initial_interval,
|
65
|
+
:randomization_factor,
|
66
|
+
:multiplier,
|
67
|
+
:max_interval,
|
68
|
+
:max_elapsed_time,
|
69
|
+
:max_retries
|
50
70
|
)
|
51
71
|
|
52
72
|
# Retry options for server calls when retry is enabled (which it is by default on all high-level {Client} calls).
|
@@ -64,27 +84,24 @@ module Temporalio
|
|
64
84
|
# @return [Float] Maximum total time, default 10.0. Can use 0 for no max.
|
65
85
|
# @!attribute max_retries
|
66
86
|
# @return [Integer] Maximum number of retries, default 10.
|
67
|
-
RPCRetryOptions
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
def initialize(**kwargs)
|
77
|
-
# @type var kwargs: untyped
|
78
|
-
kwargs[:initial_interval] = 0.1 unless kwargs.key?(:initial_interval)
|
79
|
-
kwargs[:randomization_factor] = 0.2 unless kwargs.key?(:randomization_factor)
|
80
|
-
kwargs[:multiplier] = 1.5 unless kwargs.key?(:multiplier)
|
81
|
-
kwargs[:max_interval] = 5.0 unless kwargs.key?(:max_interval)
|
82
|
-
kwargs[:max_elapsed_time] = 10.0 unless kwargs.key?(:max_elapsed_time)
|
83
|
-
kwargs[:max_retries] = 10 unless kwargs.key?(:max_retries)
|
87
|
+
class RPCRetryOptions
|
88
|
+
def initialize(
|
89
|
+
initial_interval: 0.1,
|
90
|
+
randomization_factor: 0.2,
|
91
|
+
multiplier: 1.5,
|
92
|
+
max_interval: 5.0,
|
93
|
+
max_elapsed_time: 10.0,
|
94
|
+
max_retries: 10
|
95
|
+
)
|
84
96
|
super
|
85
97
|
end
|
86
98
|
end
|
87
99
|
|
100
|
+
KeepAliveOptions = Data.define(
|
101
|
+
:interval,
|
102
|
+
:timeout
|
103
|
+
)
|
104
|
+
|
88
105
|
# Keep-alive options for client connections. For most users, the default is preferred.
|
89
106
|
#
|
90
107
|
# @!attribute interval
|
@@ -92,19 +109,18 @@ module Temporalio
|
|
92
109
|
# @!attribute timeout
|
93
110
|
# @return [Float] Timeout that the keep alive must be responded to within or the connection will be closed,
|
94
111
|
# default 15.0.
|
95
|
-
KeepAliveOptions
|
96
|
-
:
|
97
|
-
:timeout,
|
98
|
-
keyword_init: true
|
99
|
-
) do
|
100
|
-
def initialize(**kwargs)
|
101
|
-
# @type var kwargs: untyped
|
102
|
-
kwargs[:interval] = 30.0 unless kwargs.key?(:interval)
|
103
|
-
kwargs[:timeout] = 15.0 unless kwargs.key?(:timeout)
|
112
|
+
class KeepAliveOptions
|
113
|
+
def initialize(interval: 30.0, timeout: 15.0)
|
104
114
|
super
|
105
115
|
end
|
106
116
|
end
|
107
117
|
|
118
|
+
HTTPConnectProxyOptions = Data.define(
|
119
|
+
:target_host,
|
120
|
+
:basic_auth_user,
|
121
|
+
:basic_auth_pass
|
122
|
+
)
|
123
|
+
|
108
124
|
# Options for HTTP CONNECT proxy for client connections.
|
109
125
|
#
|
110
126
|
# @!attribute target_host
|
@@ -113,14 +129,11 @@ module Temporalio
|
|
113
129
|
# @return [String, nil] User for HTTP basic auth for the proxy, must be combined with {basic_auth_pass}.
|
114
130
|
# @!attribute basic_auth_pass
|
115
131
|
# @return [String, nil] Pass for HTTP basic auth for the proxy, must be combined with {basic_auth_user}.
|
116
|
-
HTTPConnectProxyOptions
|
117
|
-
:target_host,
|
118
|
-
:basic_auth_user, # Optional
|
119
|
-
:basic_auth_pass, # Optional,
|
120
|
-
keyword_init: true
|
121
|
-
)
|
132
|
+
class HTTPConnectProxyOptions; end # rubocop:disable Lint/EmptyClass
|
122
133
|
|
123
|
-
# @return [Options] Frozen options for this client which has the same attributes as {initialize}.
|
134
|
+
# @return [Options] Frozen options for this client which has the same attributes as {initialize}. Note that if
|
135
|
+
# {api_key=} or {rpc_metadata=} are updated, the options object is replaced with those changes (it is not
|
136
|
+
# mutated in place).
|
124
137
|
attr_reader :options
|
125
138
|
|
126
139
|
# @return [WorkflowService] Raw gRPC workflow service.
|
@@ -181,6 +194,7 @@ module Temporalio
|
|
181
194
|
lazy_connect:
|
182
195
|
).freeze
|
183
196
|
# Create core client now if not lazy
|
197
|
+
@core_client_mutex = Mutex.new
|
184
198
|
_core_client unless lazy_connect
|
185
199
|
# Create service instances
|
186
200
|
@workflow_service = WorkflowService.new(self)
|
@@ -204,11 +218,43 @@ module Temporalio
|
|
204
218
|
!@core_client.nil?
|
205
219
|
end
|
206
220
|
|
221
|
+
# @return [String, nil] API key. This is a shortcut for `options.api_key`.
|
222
|
+
def api_key
|
223
|
+
@options.api_key
|
224
|
+
end
|
225
|
+
|
226
|
+
# Set the API key for all future calls. This also makes a new object for {options} with the changes.
|
227
|
+
#
|
228
|
+
# @param new_key [String, nil] New API key.
|
229
|
+
def api_key=(new_key)
|
230
|
+
# Mutate the client if connected then mutate options
|
231
|
+
@core_client_mutex.synchronize do
|
232
|
+
@core_client&.update_api_key(new_key)
|
233
|
+
@options = @options.with(api_key: new_key)
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
# @return [Hash<String, String>] RPC metadata (aka HTTP headers). This is a shortcut for `options.rpc_metadata`.
|
238
|
+
def rpc_metadata
|
239
|
+
@options.rpc_metadata
|
240
|
+
end
|
241
|
+
|
242
|
+
# Set the RPC metadata (aka HTTP headers) for all future calls. This also makes a new object for {options} with
|
243
|
+
# the changes.
|
244
|
+
#
|
245
|
+
# @param rpc_metadata [Hash<String, String>] New API key.
|
246
|
+
def rpc_metadata=(rpc_metadata)
|
247
|
+
# Mutate the client if connected then mutate options
|
248
|
+
@core_client_mutex.synchronize do
|
249
|
+
@core_client&.update_metadata(rpc_metadata)
|
250
|
+
@options = @options.with(rpc_metadata: rpc_metadata)
|
251
|
+
end
|
252
|
+
end
|
253
|
+
|
207
254
|
# @!visibility private
|
208
255
|
def _core_client
|
209
256
|
# If lazy, this needs to be done under mutex
|
210
257
|
if @options.lazy_connect
|
211
|
-
@core_client_mutex ||= Mutex.new
|
212
258
|
@core_client_mutex.synchronize do
|
213
259
|
@core_client ||= new_core_client
|
214
260
|
end
|
@@ -18,11 +18,13 @@ module Temporalio
|
|
18
18
|
end
|
19
19
|
|
20
20
|
# Input for {Outbound.start_workflow}.
|
21
|
-
StartWorkflowInput =
|
21
|
+
StartWorkflowInput = Data.define(
|
22
22
|
:workflow,
|
23
23
|
:args,
|
24
24
|
:workflow_id,
|
25
25
|
:task_queue,
|
26
|
+
:static_summary,
|
27
|
+
:static_details,
|
26
28
|
:execution_timeout,
|
27
29
|
:run_timeout,
|
28
30
|
:task_timeout,
|
@@ -35,75 +37,81 @@ module Temporalio
|
|
35
37
|
:start_delay,
|
36
38
|
:request_eager_start,
|
37
39
|
:headers,
|
38
|
-
:
|
39
|
-
|
40
|
-
|
40
|
+
:rpc_options
|
41
|
+
)
|
42
|
+
|
43
|
+
# Input for {Outbound.start_update_with_start_workflow}.
|
44
|
+
StartUpdateWithStartWorkflowInput = Data.define(
|
45
|
+
:update_id,
|
46
|
+
:update,
|
47
|
+
:args,
|
48
|
+
:wait_for_stage,
|
49
|
+
:start_workflow_operation,
|
50
|
+
:headers,
|
51
|
+
:rpc_options
|
52
|
+
)
|
53
|
+
|
54
|
+
# Input for {Outbound.signal_with_start_workflow}.
|
55
|
+
SignalWithStartWorkflowInput = Data.define(
|
56
|
+
:signal,
|
57
|
+
:args,
|
58
|
+
:start_workflow_operation,
|
59
|
+
# Headers intentionally not defined here, because they are not separate from start_workflow_operation
|
60
|
+
:rpc_options
|
41
61
|
)
|
42
62
|
|
43
63
|
# Input for {Outbound.list_workflows}.
|
44
|
-
ListWorkflowsInput =
|
64
|
+
ListWorkflowsInput = Data.define(
|
45
65
|
:query,
|
46
|
-
:
|
47
|
-
:rpc_timeout,
|
48
|
-
keyword_init: true
|
66
|
+
:rpc_options
|
49
67
|
)
|
50
68
|
|
51
69
|
# Input for {Outbound.count_workflows}.
|
52
|
-
CountWorkflowsInput =
|
70
|
+
CountWorkflowsInput = Data.define(
|
53
71
|
:query,
|
54
|
-
:
|
55
|
-
:rpc_timeout,
|
56
|
-
keyword_init: true
|
72
|
+
:rpc_options
|
57
73
|
)
|
58
74
|
|
59
75
|
# Input for {Outbound.describe_workflow}.
|
60
|
-
DescribeWorkflowInput =
|
76
|
+
DescribeWorkflowInput = Data.define(
|
61
77
|
:workflow_id,
|
62
78
|
:run_id,
|
63
|
-
:
|
64
|
-
:rpc_timeout,
|
65
|
-
keyword_init: true
|
79
|
+
:rpc_options
|
66
80
|
)
|
67
81
|
|
68
82
|
# Input for {Outbound.fetch_workflow_history_events}.
|
69
|
-
FetchWorkflowHistoryEventsInput =
|
83
|
+
FetchWorkflowHistoryEventsInput = Data.define(
|
70
84
|
:workflow_id,
|
71
85
|
:run_id,
|
72
86
|
:wait_new_event,
|
73
87
|
:event_filter_type,
|
74
88
|
:skip_archival,
|
75
|
-
:
|
76
|
-
:rpc_timeout,
|
77
|
-
keyword_init: true
|
89
|
+
:rpc_options
|
78
90
|
)
|
79
91
|
|
80
92
|
# Input for {Outbound.signal_workflow}.
|
81
|
-
SignalWorkflowInput =
|
93
|
+
SignalWorkflowInput = Data.define(
|
82
94
|
:workflow_id,
|
83
95
|
:run_id,
|
84
96
|
:signal,
|
85
97
|
:args,
|
86
98
|
:headers,
|
87
|
-
:
|
88
|
-
:rpc_timeout,
|
89
|
-
keyword_init: true
|
99
|
+
:rpc_options
|
90
100
|
)
|
91
101
|
|
92
102
|
# Input for {Outbound.query_workflow}.
|
93
|
-
QueryWorkflowInput =
|
103
|
+
QueryWorkflowInput = Data.define(
|
94
104
|
:workflow_id,
|
95
105
|
:run_id,
|
96
106
|
:query,
|
97
107
|
:args,
|
98
108
|
:reject_condition,
|
99
109
|
:headers,
|
100
|
-
:
|
101
|
-
:rpc_timeout,
|
102
|
-
keyword_init: true
|
110
|
+
:rpc_options
|
103
111
|
)
|
104
112
|
|
105
113
|
# Input for {Outbound.start_workflow_update}.
|
106
|
-
StartWorkflowUpdateInput =
|
114
|
+
StartWorkflowUpdateInput = Data.define(
|
107
115
|
:workflow_id,
|
108
116
|
:run_id,
|
109
117
|
:update_id,
|
@@ -111,78 +119,126 @@ module Temporalio
|
|
111
119
|
:args,
|
112
120
|
:wait_for_stage,
|
113
121
|
:headers,
|
114
|
-
:
|
115
|
-
:rpc_timeout,
|
116
|
-
keyword_init: true
|
122
|
+
:rpc_options
|
117
123
|
)
|
118
124
|
|
119
125
|
# Input for {Outbound.poll_workflow_update}.
|
120
|
-
PollWorkflowUpdateInput =
|
126
|
+
PollWorkflowUpdateInput = Data.define(
|
121
127
|
:workflow_id,
|
122
128
|
:run_id,
|
123
129
|
:update_id,
|
124
|
-
:
|
125
|
-
:rpc_timeout,
|
126
|
-
keyword_init: true
|
130
|
+
:rpc_options
|
127
131
|
)
|
128
132
|
|
129
133
|
# Input for {Outbound.cancel_workflow}.
|
130
|
-
CancelWorkflowInput =
|
134
|
+
CancelWorkflowInput = Data.define(
|
131
135
|
:workflow_id,
|
132
136
|
:run_id,
|
133
137
|
:first_execution_run_id,
|
134
|
-
:
|
135
|
-
:rpc_timeout,
|
136
|
-
keyword_init: true
|
138
|
+
:rpc_options
|
137
139
|
)
|
138
140
|
|
139
141
|
# Input for {Outbound.terminate_workflow}.
|
140
|
-
TerminateWorkflowInput =
|
142
|
+
TerminateWorkflowInput = Data.define(
|
141
143
|
:workflow_id,
|
142
144
|
:run_id,
|
143
145
|
:first_execution_run_id,
|
144
146
|
:reason,
|
145
147
|
:details,
|
146
|
-
:
|
147
|
-
|
148
|
-
|
148
|
+
:rpc_options
|
149
|
+
)
|
150
|
+
|
151
|
+
# Input for {Outbound.create_schedule}.
|
152
|
+
CreateScheduleInput = Data.define(
|
153
|
+
:id,
|
154
|
+
:schedule,
|
155
|
+
:trigger_immediately,
|
156
|
+
:backfills,
|
157
|
+
:memo,
|
158
|
+
:search_attributes,
|
159
|
+
:rpc_options
|
160
|
+
)
|
161
|
+
|
162
|
+
# Input for {Outbound.list_schedules}.
|
163
|
+
ListSchedulesInput = Data.define(
|
164
|
+
:query,
|
165
|
+
:rpc_options
|
166
|
+
)
|
167
|
+
|
168
|
+
# Input for {Outbound.backfill_schedule}.
|
169
|
+
BackfillScheduleInput = Data.define(
|
170
|
+
:id,
|
171
|
+
:backfills,
|
172
|
+
:rpc_options
|
173
|
+
)
|
174
|
+
|
175
|
+
# Input for {Outbound.delete_schedule}.
|
176
|
+
DeleteScheduleInput = Data.define(
|
177
|
+
:id,
|
178
|
+
:rpc_options
|
179
|
+
)
|
180
|
+
|
181
|
+
# Input for {Outbound.describe_schedule}.
|
182
|
+
DescribeScheduleInput = Data.define(
|
183
|
+
:id,
|
184
|
+
:rpc_options
|
185
|
+
)
|
186
|
+
|
187
|
+
# Input for {Outbound.pause_schedule}.
|
188
|
+
PauseScheduleInput = Data.define(
|
189
|
+
:id,
|
190
|
+
:note,
|
191
|
+
:rpc_options
|
192
|
+
)
|
193
|
+
|
194
|
+
# Input for {Outbound.trigger_schedule}.
|
195
|
+
TriggerScheduleInput = Data.define(
|
196
|
+
:id,
|
197
|
+
:overlap,
|
198
|
+
:rpc_options
|
199
|
+
)
|
200
|
+
|
201
|
+
# Input for {Outbound.unpause_schedule}.
|
202
|
+
UnpauseScheduleInput = Data.define(
|
203
|
+
:id,
|
204
|
+
:note,
|
205
|
+
:rpc_options
|
206
|
+
)
|
207
|
+
|
208
|
+
# Input for {Outbound.update_schedule}.
|
209
|
+
UpdateScheduleInput = Data.define(
|
210
|
+
:id,
|
211
|
+
:updater,
|
212
|
+
:rpc_options
|
149
213
|
)
|
150
214
|
|
151
215
|
# Input for {Outbound.heartbeat_async_activity}.
|
152
|
-
HeartbeatAsyncActivityInput =
|
216
|
+
HeartbeatAsyncActivityInput = Data.define(
|
153
217
|
:task_token_or_id_reference,
|
154
218
|
:details,
|
155
|
-
:
|
156
|
-
:rpc_timeout,
|
157
|
-
keyword_init: true
|
219
|
+
:rpc_options
|
158
220
|
)
|
159
221
|
|
160
222
|
# Input for {Outbound.complete_async_activity}.
|
161
|
-
CompleteAsyncActivityInput =
|
223
|
+
CompleteAsyncActivityInput = Data.define(
|
162
224
|
:task_token_or_id_reference,
|
163
225
|
:result,
|
164
|
-
:
|
165
|
-
:rpc_timeout,
|
166
|
-
keyword_init: true
|
226
|
+
:rpc_options
|
167
227
|
)
|
168
228
|
|
169
229
|
# Input for {Outbound.fail_async_activity}.
|
170
|
-
FailAsyncActivityInput =
|
230
|
+
FailAsyncActivityInput = Data.define(
|
171
231
|
:task_token_or_id_reference,
|
172
232
|
:error,
|
173
233
|
:last_heartbeat_details,
|
174
|
-
:
|
175
|
-
:rpc_timeout,
|
176
|
-
keyword_init: true
|
234
|
+
:rpc_options
|
177
235
|
)
|
178
236
|
|
179
237
|
# Input for {Outbound.report_cancellation_async_activity}.
|
180
|
-
ReportCancellationAsyncActivityInput =
|
238
|
+
ReportCancellationAsyncActivityInput = Data.define(
|
181
239
|
:task_token_or_id_reference,
|
182
240
|
:details,
|
183
|
-
:
|
184
|
-
:rpc_timeout,
|
185
|
-
keyword_init: true
|
241
|
+
:rpc_options
|
186
242
|
)
|
187
243
|
|
188
244
|
# Outbound interceptor for intercepting client calls. This should be extended by users needing to intercept client
|
@@ -206,6 +262,23 @@ module Temporalio
|
|
206
262
|
next_interceptor.start_workflow(input)
|
207
263
|
end
|
208
264
|
|
265
|
+
# Called for every {Client.start_update_with_start_workflow} and {Client.execute_update_with_start_workflow}
|
266
|
+
# call.
|
267
|
+
#
|
268
|
+
# @param input [StartUpdateWithStartWorkflowInput] Input.
|
269
|
+
# @return [WorkflowUpdateHandle] Workflow update handle.
|
270
|
+
def start_update_with_start_workflow(input)
|
271
|
+
next_interceptor.start_update_with_start_workflow(input)
|
272
|
+
end
|
273
|
+
|
274
|
+
# Called for every {Client.signal_with_start_workflow}.
|
275
|
+
#
|
276
|
+
# @param input [SignalWithStartWorkflowInput] Input.
|
277
|
+
# @return [WorkflowHandle] Workflow handle.
|
278
|
+
def signal_with_start_workflow(input)
|
279
|
+
next_interceptor.signal_with_start_workflow(input)
|
280
|
+
end
|
281
|
+
|
209
282
|
# Called for every {Client.list_workflows} call.
|
210
283
|
#
|
211
284
|
# @param input [ListWorkflowsInput] Input.
|
@@ -283,6 +356,72 @@ module Temporalio
|
|
283
356
|
next_interceptor.terminate_workflow(input)
|
284
357
|
end
|
285
358
|
|
359
|
+
# Called for every {Client.create_schedule} call.
|
360
|
+
#
|
361
|
+
# @param input [CreateScheduleInput] Input.
|
362
|
+
# @return [ScheduleHandle] Schedule handle.
|
363
|
+
def create_schedule(input)
|
364
|
+
next_interceptor.create_schedule(input)
|
365
|
+
end
|
366
|
+
|
367
|
+
# Called for every {Client.list_schedules} call.
|
368
|
+
#
|
369
|
+
# @param input [ListSchedulesInput] Input.
|
370
|
+
# @return [Enumerator<Schedule::List::Description>] Enumerable schedules.
|
371
|
+
def list_schedules(input)
|
372
|
+
next_interceptor.list_schedules(input)
|
373
|
+
end
|
374
|
+
|
375
|
+
# Called for every {ScheduleHandle.backfill} call.
|
376
|
+
#
|
377
|
+
# @param input [BackfillScheduleInput] Input.
|
378
|
+
def backfill_schedule(input)
|
379
|
+
next_interceptor.backfill_schedule(input)
|
380
|
+
end
|
381
|
+
|
382
|
+
# Called for every {ScheduleHandle.delete} call.
|
383
|
+
#
|
384
|
+
# @param input [DeleteScheduleInput] Input.
|
385
|
+
def delete_schedule(input)
|
386
|
+
next_interceptor.delete_schedule(input)
|
387
|
+
end
|
388
|
+
|
389
|
+
# Called for every {ScheduleHandle.describe} call.
|
390
|
+
#
|
391
|
+
# @param input [DescribeScheduleInput] Input.
|
392
|
+
# @return [Schedule::Description] Schedule description.
|
393
|
+
def describe_schedule(input)
|
394
|
+
next_interceptor.describe_schedule(input)
|
395
|
+
end
|
396
|
+
|
397
|
+
# Called for every {ScheduleHandle.pause} call.
|
398
|
+
#
|
399
|
+
# @param input [PauseScheduleInput] Input.
|
400
|
+
def pause_schedule(input)
|
401
|
+
next_interceptor.pause_schedule(input)
|
402
|
+
end
|
403
|
+
|
404
|
+
# Called for every {ScheduleHandle.trigger} call.
|
405
|
+
#
|
406
|
+
# @param input [TriggerScheduleInput] Input.
|
407
|
+
def trigger_schedule(input)
|
408
|
+
next_interceptor.trigger_schedule(input)
|
409
|
+
end
|
410
|
+
|
411
|
+
# Called for every {ScheduleHandle.unpause} call.
|
412
|
+
#
|
413
|
+
# @param input [UnpauseScheduleInput] Input.
|
414
|
+
def unpause_schedule(input)
|
415
|
+
next_interceptor.unpause_schedule(input)
|
416
|
+
end
|
417
|
+
|
418
|
+
# Called for every {ScheduleHandle.update} call.
|
419
|
+
#
|
420
|
+
# @param input [UpdateScheduleInput] Input.
|
421
|
+
def update_schedule(input)
|
422
|
+
next_interceptor.update_schedule(input)
|
423
|
+
end
|
424
|
+
|
286
425
|
# Called for every {AsyncActivityHandle.heartbeat} call.
|
287
426
|
#
|
288
427
|
# @param input [HeartbeatAsyncActivityInput] Input.
|