@temporalio/core-bridge 1.15.0 → 1.16.1
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.
- package/Cargo.lock +172 -70
- package/lib/native.d.ts +1 -1
- package/package.json +2 -2
- package/releases/aarch64-apple-darwin/index.node +0 -0
- package/releases/aarch64-unknown-linux-gnu/index.node +0 -0
- package/releases/x86_64-apple-darwin/index.node +0 -0
- package/releases/x86_64-pc-windows-msvc/index.node +0 -0
- package/releases/x86_64-unknown-linux-gnu/index.node +0 -0
- package/sdk-core/.github/workflows/per-pr.yml +6 -6
- package/sdk-core/AGENTS.md +41 -30
- package/sdk-core/Cargo.toml +3 -0
- package/sdk-core/README.md +15 -9
- package/sdk-core/crates/client/Cargo.toml +4 -0
- package/sdk-core/crates/client/README.md +139 -0
- package/sdk-core/crates/client/src/async_activity_handle.rs +297 -0
- package/sdk-core/crates/client/src/callback_based.rs +7 -0
- package/sdk-core/crates/client/src/errors.rs +294 -0
- package/sdk-core/crates/client/src/{raw.rs → grpc.rs} +280 -159
- package/sdk-core/crates/client/src/lib.rs +920 -1326
- package/sdk-core/crates/client/src/metrics.rs +24 -33
- package/sdk-core/crates/client/src/options_structs.rs +457 -0
- package/sdk-core/crates/client/src/replaceable.rs +5 -4
- package/sdk-core/crates/client/src/request_extensions.rs +8 -9
- package/sdk-core/crates/client/src/retry.rs +99 -54
- package/sdk-core/crates/client/src/{worker/mod.rs → worker.rs} +1 -1
- package/sdk-core/crates/client/src/workflow_handle.rs +826 -0
- package/sdk-core/crates/common/Cargo.toml +61 -2
- package/sdk-core/crates/common/build.rs +742 -12
- package/sdk-core/crates/common/protos/api_upstream/.github/workflows/ci.yml +2 -0
- package/sdk-core/crates/common/protos/api_upstream/Makefile +2 -1
- package/sdk-core/crates/common/protos/api_upstream/buf.yaml +0 -3
- package/sdk-core/crates/common/protos/api_upstream/cmd/check-path-conflicts/main.go +137 -0
- package/sdk-core/crates/common/protos/api_upstream/openapi/openapiv2.json +1166 -770
- package/sdk-core/crates/common/protos/api_upstream/openapi/openapiv3.yaml +1243 -750
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/deployment/v1/message.proto +2 -2
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/enums/v1/workflow.proto +4 -3
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/failure/v1/message.proto +1 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/history/v1/message.proto +4 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/namespace/v1/message.proto +6 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/nexus/v1/message.proto +16 -1
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +64 -6
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +88 -33
- package/sdk-core/crates/common/protos/local/temporal/sdk/core/nexus/nexus.proto +4 -2
- package/sdk-core/crates/common/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +4 -0
- package/sdk-core/crates/common/protos/local/temporal/sdk/core/workflow_commands/workflow_commands.proto +5 -5
- package/sdk-core/crates/common/src/activity_definition.rs +20 -0
- package/sdk-core/crates/common/src/data_converters.rs +770 -0
- package/sdk-core/crates/common/src/envconfig.rs +5 -0
- package/sdk-core/crates/common/src/lib.rs +15 -211
- package/sdk-core/crates/common/src/payload_visitor.rs +648 -0
- package/sdk-core/crates/common/src/priority.rs +110 -0
- package/sdk-core/crates/common/src/protos/canned_histories.rs +3 -0
- package/sdk-core/crates/common/src/protos/history_builder.rs +45 -0
- package/sdk-core/crates/common/src/protos/history_info.rs +2 -0
- package/sdk-core/crates/common/src/protos/mod.rs +122 -27
- package/sdk-core/crates/common/src/protos/task_token.rs +3 -3
- package/sdk-core/crates/common/src/protos/utilities.rs +11 -0
- package/sdk-core/crates/{sdk-core → common}/src/telemetry/log_export.rs +5 -7
- package/sdk-core/crates/common/src/telemetry/metrics/core.rs +125 -0
- package/sdk-core/crates/common/src/telemetry/metrics.rs +268 -223
- package/sdk-core/crates/{sdk-core → common}/src/telemetry/otel.rs +8 -13
- package/sdk-core/crates/{sdk-core → common}/src/telemetry/prometheus_meter.rs +49 -50
- package/sdk-core/crates/{sdk-core → common}/src/telemetry/prometheus_server.rs +2 -3
- package/sdk-core/crates/common/src/telemetry.rs +264 -4
- package/sdk-core/crates/common/src/worker.rs +68 -603
- package/sdk-core/crates/common/src/workflow_definition.rs +60 -0
- package/sdk-core/crates/macros/Cargo.toml +5 -1
- package/sdk-core/crates/macros/src/activities_definitions.rs +585 -0
- package/sdk-core/crates/macros/src/fsm_impl.rs +507 -0
- package/sdk-core/crates/macros/src/lib.rs +138 -512
- package/sdk-core/crates/macros/src/macro_utils.rs +106 -0
- package/sdk-core/crates/macros/src/workflow_definitions.rs +1224 -0
- package/sdk-core/crates/sdk/Cargo.toml +19 -6
- package/sdk-core/crates/sdk/README.md +415 -0
- package/sdk-core/crates/sdk/src/activities.rs +417 -0
- package/sdk-core/crates/sdk/src/interceptors.rs +1 -1
- package/sdk-core/crates/sdk/src/lib.rs +757 -442
- package/sdk-core/crates/sdk/src/workflow_context/options.rs +45 -35
- package/sdk-core/crates/sdk/src/workflow_context.rs +1033 -289
- package/sdk-core/crates/sdk/src/workflow_future.rs +277 -213
- package/sdk-core/crates/sdk/src/workflows.rs +711 -0
- package/sdk-core/crates/sdk-core/Cargo.toml +57 -64
- package/sdk-core/crates/sdk-core/benches/workflow_replay_bench.rs +41 -35
- package/sdk-core/crates/sdk-core/machine_coverage/ActivityMachine_Coverage.puml +1 -1
- package/sdk-core/crates/sdk-core/src/abstractions.rs +6 -10
- package/sdk-core/crates/sdk-core/src/core_tests/activity_tasks.rs +6 -5
- package/sdk-core/crates/sdk-core/src/core_tests/mod.rs +13 -15
- package/sdk-core/crates/sdk-core/src/core_tests/queries.rs +21 -25
- package/sdk-core/crates/sdk-core/src/core_tests/replay_flag.rs +7 -10
- package/sdk-core/crates/sdk-core/src/core_tests/updates.rs +14 -17
- package/sdk-core/crates/sdk-core/src/core_tests/workers.rs +493 -26
- package/sdk-core/crates/sdk-core/src/core_tests/workflow_tasks.rs +4 -8
- package/sdk-core/crates/sdk-core/src/ephemeral_server/mod.rs +7 -7
- package/sdk-core/crates/sdk-core/src/histfetch.rs +20 -10
- package/sdk-core/crates/sdk-core/src/lib.rs +41 -111
- package/sdk-core/crates/sdk-core/src/pollers/mod.rs +4 -9
- package/sdk-core/crates/sdk-core/src/pollers/poll_buffer.rs +118 -19
- package/sdk-core/crates/sdk-core/src/protosext/mod.rs +2 -2
- package/sdk-core/crates/sdk-core/src/replay/mod.rs +14 -5
- package/sdk-core/crates/sdk-core/src/telemetry/metrics.rs +179 -196
- package/sdk-core/crates/sdk-core/src/telemetry/mod.rs +3 -280
- package/sdk-core/crates/sdk-core/src/test_help/integ_helpers.rs +6 -9
- package/sdk-core/crates/sdk-core/src/test_help/unit_helpers.rs +3 -6
- package/sdk-core/crates/sdk-core/src/worker/activities/local_activities.rs +11 -14
- package/sdk-core/crates/sdk-core/src/worker/activities.rs +16 -19
- package/sdk-core/crates/sdk-core/src/worker/client/mocks.rs +9 -5
- package/sdk-core/crates/sdk-core/src/worker/client.rs +103 -81
- package/sdk-core/crates/sdk-core/src/worker/heartbeat.rs +7 -11
- package/sdk-core/crates/sdk-core/src/worker/mod.rs +1124 -229
- package/sdk-core/crates/sdk-core/src/worker/nexus.rs +145 -23
- package/sdk-core/crates/sdk-core/src/worker/slot_provider.rs +2 -2
- package/sdk-core/crates/sdk-core/src/worker/tuner/fixed_size.rs +2 -2
- package/sdk-core/crates/sdk-core/src/worker/tuner/resource_based.rs +13 -13
- package/sdk-core/crates/sdk-core/src/worker/tuner.rs +28 -8
- package/sdk-core/crates/sdk-core/src/worker/workflow/driven_workflow.rs +9 -3
- package/sdk-core/crates/sdk-core/src/worker/workflow/machines/upsert_search_attributes_state_machine.rs +21 -22
- package/sdk-core/crates/sdk-core/src/worker/workflow/machines/workflow_machines.rs +19 -4
- package/sdk-core/crates/sdk-core/src/worker/workflow/managed_run.rs +14 -18
- package/sdk-core/crates/sdk-core/src/worker/workflow/mod.rs +4 -6
- package/sdk-core/crates/sdk-core/src/worker/workflow/run_cache.rs +4 -7
- package/sdk-core/crates/sdk-core/src/worker/workflow/wft_extraction.rs +2 -4
- package/sdk-core/crates/sdk-core/src/worker/workflow/wft_poller.rs +8 -9
- package/sdk-core/crates/sdk-core/src/worker/workflow/workflow_stream.rs +1 -3
- package/sdk-core/crates/sdk-core/tests/activities_procmacro.rs +6 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/basic_pass.rs +54 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/invalid_self_type_fail.rs +18 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/invalid_self_type_fail.stderr +5 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/missing_context_fail.rs +14 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/missing_context_fail.stderr +5 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/multi_arg_pass.rs +48 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/no_input_pass.rs +14 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/no_return_type_pass.rs +19 -0
- package/sdk-core/crates/sdk-core/tests/cloud_tests.rs +14 -5
- package/sdk-core/crates/sdk-core/tests/common/activity_functions.rs +55 -0
- package/sdk-core/crates/sdk-core/tests/common/mod.rs +241 -196
- package/sdk-core/crates/sdk-core/tests/common/workflows.rs +41 -28
- package/sdk-core/crates/sdk-core/tests/global_metric_tests.rs +3 -5
- package/sdk-core/crates/sdk-core/tests/heavy_tests/fuzzy_workflow.rs +73 -64
- package/sdk-core/crates/sdk-core/tests/heavy_tests.rs +298 -252
- package/sdk-core/crates/sdk-core/tests/integ_tests/async_activity_client_tests.rs +230 -0
- package/sdk-core/crates/sdk-core/tests/integ_tests/client_tests.rs +94 -57
- package/sdk-core/crates/sdk-core/tests/integ_tests/data_converter_tests.rs +381 -0
- package/sdk-core/crates/sdk-core/tests/integ_tests/ephemeral_server_tests.rs +16 -12
- package/sdk-core/crates/sdk-core/tests/integ_tests/heartbeat_tests.rs +48 -40
- package/sdk-core/crates/sdk-core/tests/integ_tests/metrics_tests.rs +327 -255
- package/sdk-core/crates/sdk-core/tests/integ_tests/pagination_tests.rs +50 -45
- package/sdk-core/crates/sdk-core/tests/integ_tests/polling_tests.rs +147 -126
- package/sdk-core/crates/sdk-core/tests/integ_tests/queries_tests.rs +103 -89
- package/sdk-core/crates/sdk-core/tests/integ_tests/update_tests.rs +609 -453
- package/sdk-core/crates/sdk-core/tests/integ_tests/visibility_tests.rs +80 -62
- package/sdk-core/crates/sdk-core/tests/integ_tests/worker_heartbeat_tests.rs +360 -231
- package/sdk-core/crates/sdk-core/tests/integ_tests/worker_tests.rs +248 -185
- package/sdk-core/crates/sdk-core/tests/integ_tests/worker_versioning_tests.rs +52 -43
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_client_tests.rs +180 -0
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/activities.rs +428 -315
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/cancel_external.rs +82 -56
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/cancel_wf.rs +56 -28
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/child_workflows.rs +364 -243
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/client_interactions.rs +552 -0
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/continue_as_new.rs +101 -42
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/determinism.rs +243 -147
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/eager.rs +98 -28
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/local_activities.rs +1475 -1036
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/modify_wf_properties.rs +73 -41
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/nexus.rs +397 -238
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/patches.rs +414 -189
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/queries.rs +415 -0
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/replay.rs +96 -36
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/resets.rs +154 -137
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/signals.rs +183 -105
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/stickyness.rs +85 -38
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/timers.rs +142 -40
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/upsert_search_attrs.rs +73 -54
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests.rs +363 -226
- package/sdk-core/crates/sdk-core/tests/main.rs +17 -15
- package/sdk-core/crates/sdk-core/tests/manual_tests.rs +207 -152
- package/sdk-core/crates/sdk-core/tests/shared_tests/mod.rs +65 -34
- package/sdk-core/crates/sdk-core/tests/shared_tests/priority.rs +107 -84
- package/sdk-core/crates/sdk-core/tests/workflows_procmacro.rs +6 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/async_query_fail.rs +26 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/async_query_fail.stderr +5 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/basic_pass.rs +49 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/minimal_pass.rs +21 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/mut_query_fail.rs +26 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/mut_query_fail.stderr +5 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/sync_run_fail.rs +21 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/sync_run_fail.stderr +5 -0
- package/sdk-core/crates/sdk-core-c-bridge/Cargo.toml +7 -1
- package/sdk-core/crates/sdk-core-c-bridge/include/temporal-sdk-core-c-bridge.h +14 -14
- package/sdk-core/crates/sdk-core-c-bridge/src/client.rs +83 -74
- package/sdk-core/crates/sdk-core-c-bridge/src/metric.rs +9 -14
- package/sdk-core/crates/sdk-core-c-bridge/src/runtime.rs +1 -2
- package/sdk-core/crates/sdk-core-c-bridge/src/tests/context.rs +13 -13
- package/sdk-core/crates/sdk-core-c-bridge/src/tests/mod.rs +6 -6
- package/sdk-core/crates/sdk-core-c-bridge/src/tests/utils.rs +3 -4
- package/sdk-core/crates/sdk-core-c-bridge/src/worker.rs +62 -75
- package/sdk-core/rustfmt.toml +2 -1
- package/src/client.rs +205 -318
- package/src/metrics.rs +22 -30
- package/src/runtime.rs +4 -5
- package/src/worker.rs +16 -19
- package/ts/native.ts +1 -1
- package/sdk-core/crates/client/src/workflow_handle/mod.rs +0 -212
- package/sdk-core/crates/common/src/errors.rs +0 -85
- package/sdk-core/crates/common/tests/worker_task_types_test.rs +0 -129
- package/sdk-core/crates/sdk/src/activity_context.rs +0 -238
- package/sdk-core/crates/sdk/src/app_data.rs +0 -37
- package/sdk-core/crates/sdk-core/tests/integ_tests/activity_functions.rs +0 -5
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/appdata_propagation.rs +0 -61
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
use std::{collections::HashMap, time::Duration};
|
|
2
2
|
|
|
3
|
-
use temporalio_client::
|
|
3
|
+
use temporalio_client::Priority;
|
|
4
4
|
use temporalio_common::protos::{
|
|
5
5
|
coresdk::{
|
|
6
6
|
AsJsonPayloadExt,
|
|
@@ -12,8 +12,8 @@ use temporalio_common::protos::{
|
|
|
12
12
|
},
|
|
13
13
|
},
|
|
14
14
|
temporal::api::{
|
|
15
|
-
common::v1::{Payload, RetryPolicy},
|
|
16
|
-
enums::v1::ParentClosePolicy,
|
|
15
|
+
common::v1::{Payload, RetryPolicy, SearchAttributes},
|
|
16
|
+
enums::v1::{ParentClosePolicy, WorkflowIdReusePolicy},
|
|
17
17
|
sdk::v1::UserMetadata,
|
|
18
18
|
},
|
|
19
19
|
};
|
|
@@ -33,10 +33,6 @@ pub struct ActivityOptions {
|
|
|
33
33
|
///
|
|
34
34
|
/// If `None` use the context's sequence number
|
|
35
35
|
pub activity_id: Option<String>,
|
|
36
|
-
/// Type of activity to schedule
|
|
37
|
-
pub activity_type: String,
|
|
38
|
-
/// Input to the activity
|
|
39
|
-
pub input: Payload,
|
|
40
36
|
/// Task queue to schedule the activity in
|
|
41
37
|
///
|
|
42
38
|
/// If `None`, use the same task queue as the parent workflow.
|
|
@@ -76,8 +72,13 @@ pub struct ActivityOptions {
|
|
|
76
72
|
pub do_not_eagerly_execute: bool,
|
|
77
73
|
}
|
|
78
74
|
|
|
79
|
-
impl
|
|
80
|
-
fn into_command(
|
|
75
|
+
impl ActivityOptions {
|
|
76
|
+
pub(crate) fn into_command(
|
|
77
|
+
self,
|
|
78
|
+
activity_type: String,
|
|
79
|
+
arguments: Vec<Payload>,
|
|
80
|
+
seq: u32,
|
|
81
|
+
) -> WorkflowCommand {
|
|
81
82
|
WorkflowCommand {
|
|
82
83
|
variant: Some(
|
|
83
84
|
ScheduleActivity {
|
|
@@ -86,7 +87,7 @@ impl IntoWorkflowCommand for ActivityOptions {
|
|
|
86
87
|
None => seq.to_string(),
|
|
87
88
|
Some(aid) => aid,
|
|
88
89
|
},
|
|
89
|
-
activity_type
|
|
90
|
+
activity_type,
|
|
90
91
|
task_queue: self.task_queue.unwrap_or_default(),
|
|
91
92
|
schedule_to_close_timeout: self
|
|
92
93
|
.schedule_to_close_timeout
|
|
@@ -99,7 +100,7 @@ impl IntoWorkflowCommand for ActivityOptions {
|
|
|
99
100
|
.and_then(|d| d.try_into().ok()),
|
|
100
101
|
heartbeat_timeout: self.heartbeat_timeout.and_then(|d| d.try_into().ok()),
|
|
101
102
|
cancellation_type: self.cancellation_type as i32,
|
|
102
|
-
arguments
|
|
103
|
+
arguments,
|
|
103
104
|
retry_policy: self.retry_policy,
|
|
104
105
|
priority: self.priority.map(Into::into),
|
|
105
106
|
do_not_eagerly_execute: self.do_not_eagerly_execute,
|
|
@@ -124,11 +125,6 @@ pub struct LocalActivityOptions {
|
|
|
124
125
|
///
|
|
125
126
|
/// If `None` use the context's sequence number
|
|
126
127
|
pub activity_id: Option<String>,
|
|
127
|
-
/// Type of activity to schedule
|
|
128
|
-
pub activity_type: String,
|
|
129
|
-
/// Input to the activity
|
|
130
|
-
// TODO: Make optional
|
|
131
|
-
pub input: Payload,
|
|
132
128
|
/// Retry policy
|
|
133
129
|
pub retry_policy: RetryPolicy,
|
|
134
130
|
/// Override attempt number rather than using 1.
|
|
@@ -160,8 +156,13 @@ pub struct LocalActivityOptions {
|
|
|
160
156
|
pub summary: Option<String>,
|
|
161
157
|
}
|
|
162
158
|
|
|
163
|
-
impl
|
|
164
|
-
fn into_command(
|
|
159
|
+
impl LocalActivityOptions {
|
|
160
|
+
pub(crate) fn into_command(
|
|
161
|
+
mut self,
|
|
162
|
+
activity_type: String,
|
|
163
|
+
arguments: Vec<Payload>,
|
|
164
|
+
seq: u32,
|
|
165
|
+
) -> WorkflowCommand {
|
|
165
166
|
// Allow tests to avoid extra verbosity when they don't care about timeouts
|
|
166
167
|
// TODO: Builderize LA options
|
|
167
168
|
self.schedule_to_close_timeout
|
|
@@ -177,8 +178,8 @@ impl IntoWorkflowCommand for LocalActivityOptions {
|
|
|
177
178
|
None => seq.to_string(),
|
|
178
179
|
Some(aid) => aid,
|
|
179
180
|
},
|
|
180
|
-
activity_type
|
|
181
|
-
arguments
|
|
181
|
+
activity_type,
|
|
182
|
+
arguments,
|
|
182
183
|
retry_policy: Some(self.retry_policy),
|
|
183
184
|
local_retry_threshold: self
|
|
184
185
|
.timer_backoff_threshold
|
|
@@ -223,14 +224,26 @@ pub struct ChildWorkflowOptions {
|
|
|
223
224
|
pub input: Vec<Payload>,
|
|
224
225
|
/// Cancellation strategy for the child workflow
|
|
225
226
|
pub cancel_type: ChildWorkflowCancellationType,
|
|
226
|
-
/// Common options
|
|
227
|
-
pub options: WorkflowOptions,
|
|
228
227
|
/// How to respond to parent workflow ending
|
|
229
228
|
pub parent_close_policy: ParentClosePolicy,
|
|
230
229
|
/// Static summary of the child workflow
|
|
231
230
|
pub static_summary: Option<String>,
|
|
232
231
|
/// Static details of the child workflow
|
|
233
232
|
pub static_details: Option<String>,
|
|
233
|
+
/// Set the policy for reusing the workflow id
|
|
234
|
+
pub id_reuse_policy: WorkflowIdReusePolicy,
|
|
235
|
+
/// Optionally set the execution timeout for the workflow
|
|
236
|
+
pub execution_timeout: Option<Duration>,
|
|
237
|
+
/// Optionally indicates the default run timeout for a workflow run
|
|
238
|
+
pub run_timeout: Option<Duration>,
|
|
239
|
+
/// Optionally indicates the default task timeout for a workflow run
|
|
240
|
+
pub task_timeout: Option<Duration>,
|
|
241
|
+
/// Optionally set a cron schedule for the workflow
|
|
242
|
+
pub cron_schedule: Option<String>,
|
|
243
|
+
/// Optionally associate extra search attributes with a workflow
|
|
244
|
+
pub search_attributes: Option<HashMap<String, Payload>>,
|
|
245
|
+
/// Priority for the workflow
|
|
246
|
+
pub priority: Option<Priority>,
|
|
234
247
|
}
|
|
235
248
|
|
|
236
249
|
impl IntoWorkflowCommand for ChildWorkflowOptions {
|
|
@@ -252,23 +265,18 @@ impl IntoWorkflowCommand for ChildWorkflowOptions {
|
|
|
252
265
|
task_queue: self.task_queue.unwrap_or_default(),
|
|
253
266
|
input: self.input,
|
|
254
267
|
cancellation_type: self.cancel_type as i32,
|
|
255
|
-
workflow_id_reuse_policy: self.
|
|
268
|
+
workflow_id_reuse_policy: self.id_reuse_policy as i32,
|
|
256
269
|
workflow_execution_timeout: self
|
|
257
|
-
.options
|
|
258
|
-
.execution_timeout
|
|
259
|
-
.and_then(|d| d.try_into().ok()),
|
|
260
|
-
workflow_run_timeout: self
|
|
261
|
-
.options
|
|
262
270
|
.execution_timeout
|
|
263
271
|
.and_then(|d| d.try_into().ok()),
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
.
|
|
268
|
-
|
|
269
|
-
cron_schedule: self.
|
|
272
|
+
workflow_run_timeout: self.execution_timeout.and_then(|d| d.try_into().ok()),
|
|
273
|
+
workflow_task_timeout: self.task_timeout.and_then(|d| d.try_into().ok()),
|
|
274
|
+
search_attributes: self
|
|
275
|
+
.search_attributes
|
|
276
|
+
.map(|sa| SearchAttributes { indexed_fields: sa }),
|
|
277
|
+
cron_schedule: self.cron_schedule.unwrap_or_default(),
|
|
270
278
|
parent_close_policy: self.parent_close_policy as i32,
|
|
271
|
-
priority: self.
|
|
279
|
+
priority: self.priority.map(Into::into),
|
|
272
280
|
..Default::default()
|
|
273
281
|
}
|
|
274
282
|
.into(),
|
|
@@ -279,6 +287,7 @@ impl IntoWorkflowCommand for ChildWorkflowOptions {
|
|
|
279
287
|
}
|
|
280
288
|
|
|
281
289
|
/// Options for sending a signal to an external workflow
|
|
290
|
+
#[derive(Debug)]
|
|
282
291
|
pub struct SignalWorkflowOptions {
|
|
283
292
|
/// The workflow's id
|
|
284
293
|
pub workflow_id: String,
|
|
@@ -315,6 +324,7 @@ impl SignalWorkflowOptions {
|
|
|
315
324
|
}
|
|
316
325
|
|
|
317
326
|
/// Information needed to send a specific signal
|
|
327
|
+
#[derive(Debug)]
|
|
318
328
|
pub struct Signal {
|
|
319
329
|
/// The signal name
|
|
320
330
|
pub signal_name: String,
|