@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
package/src/client.rs
CHANGED
|
@@ -5,10 +5,10 @@ use std::{collections::HashMap, sync::Arc};
|
|
|
5
5
|
use neon::prelude::*;
|
|
6
6
|
use tonic::metadata::{BinaryMetadataValue, MetadataKey};
|
|
7
7
|
|
|
8
|
-
use temporalio_sdk_core::
|
|
8
|
+
use temporalio_sdk_core::CoreRuntime;
|
|
9
9
|
|
|
10
10
|
use bridge_macros::{TryFromJs, js_function};
|
|
11
|
-
use temporalio_client::{
|
|
11
|
+
use temporalio_client::{Connection, errors::ClientConnectError};
|
|
12
12
|
|
|
13
13
|
use crate::runtime::Runtime;
|
|
14
14
|
use crate::{helpers::*, runtime::RuntimeExt as _};
|
|
@@ -38,12 +38,10 @@ pub fn init(cx: &mut neon::prelude::ModuleContext) -> neon::prelude::NeonResult<
|
|
|
38
38
|
Ok(())
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
type CoreClient = RetryClient<ConfiguredClient<TemporalServiceClient>>;
|
|
42
|
-
|
|
43
41
|
pub struct Client {
|
|
44
42
|
// These fields are pub because they are accessed from Worker::new
|
|
45
43
|
pub(crate) core_runtime: Arc<CoreRuntime>,
|
|
46
|
-
pub(crate)
|
|
44
|
+
pub(crate) core_connection: Connection,
|
|
47
45
|
}
|
|
48
46
|
|
|
49
47
|
/// Create a connected gRPC client which can be used to initialize workers.
|
|
@@ -53,33 +51,32 @@ pub fn client_new(
|
|
|
53
51
|
config: config::ClientOptions,
|
|
54
52
|
) -> BridgeResult<BridgeFuture<OpaqueOutboundHandle<Client>>> {
|
|
55
53
|
let runtime = runtime.borrow()?.core_runtime.clone();
|
|
56
|
-
let
|
|
54
|
+
let metric_meter = runtime.telemetry().get_temporal_metric_meter();
|
|
55
|
+
let options = config.into_connection_options(metric_meter);
|
|
57
56
|
|
|
58
57
|
runtime.clone().future_to_promise(async move {
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
let core_client = match res {
|
|
63
|
-
Ok(core_client) => core_client,
|
|
64
|
-
Err(ClientInitError::InvalidHeaders(e)) => Err(BridgeError::TypeError {
|
|
58
|
+
let core_connection = match Connection::connect(options).await {
|
|
59
|
+
Ok(conn) => conn,
|
|
60
|
+
Err(ClientConnectError::InvalidHeaders(e)) => Err(BridgeError::TypeError {
|
|
65
61
|
message: format!("Invalid metadata key: {e}"),
|
|
66
62
|
field: None,
|
|
67
63
|
})?,
|
|
68
|
-
Err(
|
|
64
|
+
Err(ClientConnectError::SystemInfoCallError(e)) => Err(BridgeError::TransportError(
|
|
69
65
|
format!("Failed to call GetSystemInfo: {e}"),
|
|
70
66
|
))?,
|
|
71
|
-
Err(
|
|
67
|
+
Err(ClientConnectError::TonicTransportError(e)) => {
|
|
72
68
|
Err(BridgeError::TransportError(format!("{e:?}")))?
|
|
73
69
|
}
|
|
74
|
-
Err(
|
|
70
|
+
Err(ClientConnectError::InvalidUri(e)) => Err(BridgeError::TypeError {
|
|
75
71
|
message: e.to_string(),
|
|
76
72
|
field: None,
|
|
77
73
|
})?,
|
|
74
|
+
Err(e) => Err(BridgeError::TransportError(format!("{e:?}")))?,
|
|
78
75
|
};
|
|
79
76
|
|
|
80
77
|
Ok(OpaqueOutboundHandle::new(Client {
|
|
81
78
|
core_runtime: runtime,
|
|
82
|
-
|
|
79
|
+
core_connection,
|
|
83
80
|
}))
|
|
84
81
|
})
|
|
85
82
|
}
|
|
@@ -93,8 +90,7 @@ pub fn client_update_headers(
|
|
|
93
90
|
let (ascii_headers, bin_headers) = config::partition_headers(Some(headers));
|
|
94
91
|
client
|
|
95
92
|
.borrow()?
|
|
96
|
-
.
|
|
97
|
-
.get_client()
|
|
93
|
+
.core_connection
|
|
98
94
|
.set_headers(ascii_headers.unwrap_or_default())
|
|
99
95
|
.map_err(|err| BridgeError::TypeError {
|
|
100
96
|
message: format!("Invalid metadata key: {err}"),
|
|
@@ -102,8 +98,7 @@ pub fn client_update_headers(
|
|
|
102
98
|
})?;
|
|
103
99
|
client
|
|
104
100
|
.borrow()?
|
|
105
|
-
.
|
|
106
|
-
.get_client()
|
|
101
|
+
.core_connection
|
|
107
102
|
.set_binary_headers(bin_headers.unwrap_or_default())
|
|
108
103
|
.map_err(|err| BridgeError::TypeError {
|
|
109
104
|
message: format!("Invalid metadata key: {err}"),
|
|
@@ -115,11 +110,7 @@ pub fn client_update_headers(
|
|
|
115
110
|
/// Update a Client's API key
|
|
116
111
|
#[js_function]
|
|
117
112
|
pub fn client_update_api_key(client: OpaqueInboundHandle<Client>, key: String) -> BridgeResult<()> {
|
|
118
|
-
client
|
|
119
|
-
.borrow()?
|
|
120
|
-
.core_client
|
|
121
|
-
.get_client()
|
|
122
|
-
.set_api_key(Some(key));
|
|
113
|
+
client.borrow()?.core_connection.set_api_key(Some(key));
|
|
123
114
|
Ok(())
|
|
124
115
|
}
|
|
125
116
|
|
|
@@ -158,11 +149,12 @@ pub fn client_send_workflow_service_request(
|
|
|
158
149
|
) -> BridgeResult<BridgeFuture<Vec<u8>>> {
|
|
159
150
|
let client = client.borrow()?;
|
|
160
151
|
let core_runtime = client.core_runtime.clone();
|
|
161
|
-
let
|
|
152
|
+
let core_connection = client.core_connection.clone();
|
|
162
153
|
|
|
163
154
|
// FIXME: "large future with a size of 18560 bytes"
|
|
164
|
-
core_runtime
|
|
165
|
-
|
|
155
|
+
core_runtime.future_to_promise(async move {
|
|
156
|
+
client_invoke_workflow_service(core_connection, call).await
|
|
157
|
+
})
|
|
166
158
|
}
|
|
167
159
|
|
|
168
160
|
/// Send a request to the Operator Service using the provided Client
|
|
@@ -173,10 +165,11 @@ pub fn client_send_operator_service_request(
|
|
|
173
165
|
) -> BridgeResult<BridgeFuture<Vec<u8>>> {
|
|
174
166
|
let client = client.borrow()?;
|
|
175
167
|
let core_runtime = client.core_runtime.clone();
|
|
176
|
-
let
|
|
168
|
+
let core_connection = client.core_connection.clone();
|
|
177
169
|
|
|
178
|
-
core_runtime
|
|
179
|
-
|
|
170
|
+
core_runtime.future_to_promise(async move {
|
|
171
|
+
client_invoke_operator_service(core_connection, call).await
|
|
172
|
+
})
|
|
180
173
|
}
|
|
181
174
|
|
|
182
175
|
/// Send a request to the Test Service using the provided Client
|
|
@@ -187,10 +180,10 @@ pub fn client_send_test_service_request(
|
|
|
187
180
|
) -> BridgeResult<BridgeFuture<Vec<u8>>> {
|
|
188
181
|
let client = client.borrow()?;
|
|
189
182
|
let core_runtime = client.core_runtime.clone();
|
|
190
|
-
let
|
|
183
|
+
let core_connection = client.core_connection.clone();
|
|
191
184
|
|
|
192
185
|
core_runtime
|
|
193
|
-
.future_to_promise(async move { client_invoke_test_service(
|
|
186
|
+
.future_to_promise(async move { client_invoke_test_service(core_connection, call).await })
|
|
194
187
|
}
|
|
195
188
|
|
|
196
189
|
/// Send a request to the Health Service using the provided Client
|
|
@@ -201,10 +194,10 @@ pub fn client_send_health_service_request(
|
|
|
201
194
|
) -> BridgeResult<BridgeFuture<Vec<u8>>> {
|
|
202
195
|
let client = client.borrow()?;
|
|
203
196
|
let core_runtime = client.core_runtime.clone();
|
|
204
|
-
let
|
|
197
|
+
let core_connection = client.core_connection.clone();
|
|
205
198
|
|
|
206
199
|
core_runtime
|
|
207
|
-
.future_to_promise(async move { client_invoke_health_service(
|
|
200
|
+
.future_to_promise(async move { client_invoke_health_service(core_connection, call).await })
|
|
208
201
|
}
|
|
209
202
|
|
|
210
203
|
/// Indicates that a gRPC request failed
|
|
@@ -240,11 +233,19 @@ impl TryIntoJs for tonic::Status {
|
|
|
240
233
|
}
|
|
241
234
|
|
|
242
235
|
macro_rules! rpc_call {
|
|
243
|
-
($
|
|
236
|
+
($connection:ident, $call:ident, $call_name:ident) => {
|
|
237
|
+
rpc_call!($connection, $call, $call_name, workflow_service)
|
|
238
|
+
};
|
|
239
|
+
($connection:ident, $call:ident, $call_name:ident, $service_accessor:ident) => {
|
|
244
240
|
if $call.retry {
|
|
245
|
-
rpc_resp($
|
|
241
|
+
rpc_resp($connection.$call_name(rpc_req($call)?).await)
|
|
246
242
|
} else {
|
|
247
|
-
rpc_resp(
|
|
243
|
+
rpc_resp(
|
|
244
|
+
$connection
|
|
245
|
+
.$service_accessor()
|
|
246
|
+
.$call_name(rpc_req($call)?)
|
|
247
|
+
.await,
|
|
248
|
+
)
|
|
248
249
|
}
|
|
249
250
|
};
|
|
250
251
|
}
|
|
@@ -254,297 +255,166 @@ macro_rules! rpc_call {
|
|
|
254
255
|
#[allow(clippy::large_stack_frames)]
|
|
255
256
|
#[allow(clippy::too_many_lines)]
|
|
256
257
|
async fn client_invoke_workflow_service(
|
|
257
|
-
mut
|
|
258
|
+
mut connection: Connection,
|
|
258
259
|
call: RpcCall,
|
|
259
260
|
) -> BridgeResult<Vec<u8>> {
|
|
260
|
-
use temporalio_client::WorkflowService;
|
|
261
|
+
use temporalio_client::grpc::WorkflowService;
|
|
261
262
|
|
|
262
263
|
match call.rpc.as_str() {
|
|
263
|
-
"CountActivityExecutions" =>
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
"
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
"
|
|
270
|
-
|
|
271
|
-
}
|
|
272
|
-
"CreateWorkflowRule" => {
|
|
273
|
-
rpc_call!(retry_client, call, create_workflow_rule)
|
|
274
|
-
}
|
|
275
|
-
"DeleteActivityExecution" => {
|
|
276
|
-
rpc_call!(retry_client, call, delete_activity_execution)
|
|
277
|
-
}
|
|
278
|
-
"DeleteSchedule" => {
|
|
279
|
-
rpc_call!(retry_client, call, delete_schedule)
|
|
280
|
-
}
|
|
281
|
-
"DeleteWorkerDeployment" => {
|
|
282
|
-
rpc_call!(retry_client, call, delete_worker_deployment)
|
|
283
|
-
}
|
|
264
|
+
"CountActivityExecutions" => rpc_call!(connection, call, count_activity_executions),
|
|
265
|
+
"CountSchedules" => rpc_call!(connection, call, count_schedules),
|
|
266
|
+
"CountWorkflowExecutions" => rpc_call!(connection, call, count_workflow_executions),
|
|
267
|
+
"CreateSchedule" => rpc_call!(connection, call, create_schedule),
|
|
268
|
+
"CreateWorkflowRule" => rpc_call!(connection, call, create_workflow_rule),
|
|
269
|
+
"DeleteActivityExecution" => rpc_call!(connection, call, delete_activity_execution),
|
|
270
|
+
"DeleteSchedule" => rpc_call!(connection, call, delete_schedule),
|
|
271
|
+
"DeleteWorkerDeployment" => rpc_call!(connection, call, delete_worker_deployment),
|
|
284
272
|
"DeleteWorkerDeploymentVersion" => {
|
|
285
|
-
rpc_call!(
|
|
286
|
-
}
|
|
287
|
-
"DeleteWorkflowExecution" =>
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
"
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
"
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
"
|
|
297
|
-
|
|
298
|
-
}
|
|
299
|
-
"DescribeDeployment" => {
|
|
300
|
-
rpc_call!(retry_client, call, describe_deployment)
|
|
301
|
-
}
|
|
302
|
-
"DescribeWorker" => {
|
|
303
|
-
rpc_call!(retry_client, call, describe_worker)
|
|
304
|
-
}
|
|
305
|
-
"DeprecateNamespace" => rpc_call!(retry_client, call, deprecate_namespace),
|
|
306
|
-
"DescribeNamespace" => rpc_call!(retry_client, call, describe_namespace),
|
|
307
|
-
"DescribeSchedule" => rpc_call!(retry_client, call, describe_schedule),
|
|
308
|
-
"DescribeTaskQueue" => rpc_call!(retry_client, call, describe_task_queue),
|
|
309
|
-
"DescribeWorkerDeployment" => {
|
|
310
|
-
rpc_call!(retry_client, call, describe_worker_deployment)
|
|
311
|
-
}
|
|
273
|
+
rpc_call!(connection, call, delete_worker_deployment_version)
|
|
274
|
+
}
|
|
275
|
+
"DeleteWorkflowExecution" => rpc_call!(connection, call, delete_workflow_execution),
|
|
276
|
+
"DeleteWorkflowRule" => rpc_call!(connection, call, delete_workflow_rule),
|
|
277
|
+
"DescribeBatchOperation" => rpc_call!(connection, call, describe_batch_operation),
|
|
278
|
+
"DescribeActivityExecution" => rpc_call!(connection, call, describe_activity_execution),
|
|
279
|
+
"DescribeDeployment" => rpc_call!(connection, call, describe_deployment),
|
|
280
|
+
"DescribeWorker" => rpc_call!(connection, call, describe_worker),
|
|
281
|
+
"DeprecateNamespace" => rpc_call!(connection, call, deprecate_namespace),
|
|
282
|
+
"DescribeNamespace" => rpc_call!(connection, call, describe_namespace),
|
|
283
|
+
"DescribeSchedule" => rpc_call!(connection, call, describe_schedule),
|
|
284
|
+
"DescribeTaskQueue" => rpc_call!(connection, call, describe_task_queue),
|
|
285
|
+
"DescribeWorkerDeployment" => rpc_call!(connection, call, describe_worker_deployment),
|
|
312
286
|
"DescribeWorkerDeploymentVersion" => {
|
|
313
|
-
rpc_call!(
|
|
314
|
-
}
|
|
315
|
-
"DescribeWorkflowExecution" =>
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
"
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
"
|
|
322
|
-
"
|
|
323
|
-
"
|
|
324
|
-
"GetCurrentDeployment" => rpc_call!(retry_client, call, get_current_deployment),
|
|
325
|
-
"GetDeploymentReachability" => {
|
|
326
|
-
rpc_call!(retry_client, call, get_deployment_reachability)
|
|
327
|
-
}
|
|
328
|
-
"GetSearchAttributes" => {
|
|
329
|
-
rpc_call!(retry_client, call, get_search_attributes)
|
|
330
|
-
}
|
|
331
|
-
"GetSystemInfo" => rpc_call!(retry_client, call, get_system_info),
|
|
287
|
+
rpc_call!(connection, call, describe_worker_deployment_version)
|
|
288
|
+
}
|
|
289
|
+
"DescribeWorkflowExecution" => rpc_call!(connection, call, describe_workflow_execution),
|
|
290
|
+
"DescribeWorkflowRule" => rpc_call!(connection, call, describe_workflow_rule),
|
|
291
|
+
"ExecuteMultiOperation" => rpc_call!(connection, call, execute_multi_operation),
|
|
292
|
+
"FetchWorkerConfig" => rpc_call!(connection, call, fetch_worker_config),
|
|
293
|
+
"GetClusterInfo" => rpc_call!(connection, call, get_cluster_info),
|
|
294
|
+
"GetCurrentDeployment" => rpc_call!(connection, call, get_current_deployment),
|
|
295
|
+
"GetDeploymentReachability" => rpc_call!(connection, call, get_deployment_reachability),
|
|
296
|
+
"GetSearchAttributes" => rpc_call!(connection, call, get_search_attributes),
|
|
297
|
+
"GetSystemInfo" => rpc_call!(connection, call, get_system_info),
|
|
332
298
|
"GetWorkerBuildIdCompatibility" => {
|
|
333
|
-
rpc_call!(
|
|
334
|
-
}
|
|
335
|
-
"GetWorkerTaskReachability" => {
|
|
336
|
-
rpc_call!(retry_client, call, get_worker_task_reachability)
|
|
337
|
-
}
|
|
338
|
-
"GetWorkerVersioningRules" => {
|
|
339
|
-
rpc_call!(retry_client, call, get_worker_versioning_rules)
|
|
299
|
+
rpc_call!(connection, call, get_worker_build_id_compatibility)
|
|
340
300
|
}
|
|
301
|
+
"GetWorkerTaskReachability" => rpc_call!(connection, call, get_worker_task_reachability),
|
|
302
|
+
"GetWorkerVersioningRules" => rpc_call!(connection, call, get_worker_versioning_rules),
|
|
341
303
|
"GetWorkflowExecutionHistory" => {
|
|
342
|
-
rpc_call!(
|
|
304
|
+
rpc_call!(connection, call, get_workflow_execution_history)
|
|
343
305
|
}
|
|
344
306
|
"GetWorkflowExecutionHistoryReverse" => {
|
|
345
|
-
rpc_call!(
|
|
307
|
+
rpc_call!(connection, call, get_workflow_execution_history_reverse)
|
|
346
308
|
}
|
|
347
309
|
"ListArchivedWorkflowExecutions" => {
|
|
348
|
-
rpc_call!(
|
|
349
|
-
}
|
|
350
|
-
"ListActivityExecutions" => {
|
|
351
|
-
rpc_call!(retry_client, call, list_activity_executions)
|
|
352
|
-
}
|
|
353
|
-
"ListBatchOperations" => {
|
|
354
|
-
rpc_call!(retry_client, call, list_batch_operations)
|
|
310
|
+
rpc_call!(connection, call, list_archived_workflow_executions)
|
|
355
311
|
}
|
|
312
|
+
"ListActivityExecutions" => rpc_call!(connection, call, list_activity_executions),
|
|
313
|
+
"ListBatchOperations" => rpc_call!(connection, call, list_batch_operations),
|
|
356
314
|
"ListClosedWorkflowExecutions" => {
|
|
357
|
-
rpc_call!(
|
|
358
|
-
}
|
|
359
|
-
"ListDeployments" =>
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
"
|
|
363
|
-
"
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
"
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
"
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
"
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
"ListWorkerDeployments" => {
|
|
376
|
-
rpc_call!(retry_client, call, list_worker_deployments)
|
|
377
|
-
}
|
|
378
|
-
"ListWorkers" => {
|
|
379
|
-
rpc_call!(retry_client, call, list_workers)
|
|
380
|
-
}
|
|
381
|
-
"ListWorkflowExecutions" => {
|
|
382
|
-
rpc_call!(retry_client, call, list_workflow_executions)
|
|
383
|
-
}
|
|
384
|
-
"ListWorkflowRules" => {
|
|
385
|
-
rpc_call!(retry_client, call, list_workflow_rules)
|
|
386
|
-
}
|
|
387
|
-
"PatchSchedule" => {
|
|
388
|
-
rpc_call!(retry_client, call, patch_schedule)
|
|
389
|
-
}
|
|
390
|
-
"PauseActivity" => {
|
|
391
|
-
rpc_call!(retry_client, call, pause_activity)
|
|
392
|
-
}
|
|
393
|
-
"PauseWorkflowExecution" => {
|
|
394
|
-
rpc_call!(retry_client, call, pause_workflow_execution)
|
|
395
|
-
}
|
|
396
|
-
"PollActivityExecution" => {
|
|
397
|
-
rpc_call!(retry_client, call, poll_activity_execution)
|
|
398
|
-
}
|
|
399
|
-
"PollActivityTaskQueue" => {
|
|
400
|
-
rpc_call!(retry_client, call, poll_activity_task_queue)
|
|
401
|
-
}
|
|
402
|
-
"PollNexusTaskQueue" => rpc_call!(retry_client, call, poll_nexus_task_queue),
|
|
315
|
+
rpc_call!(connection, call, list_closed_workflow_executions)
|
|
316
|
+
}
|
|
317
|
+
"ListDeployments" => rpc_call!(connection, call, list_deployments),
|
|
318
|
+
"ListNamespaces" => rpc_call!(connection, call, list_namespaces),
|
|
319
|
+
"ListOpenWorkflowExecutions" => rpc_call!(connection, call, list_open_workflow_executions),
|
|
320
|
+
"ListScheduleMatchingTimes" => rpc_call!(connection, call, list_schedule_matching_times),
|
|
321
|
+
"ListSchedules" => rpc_call!(connection, call, list_schedules),
|
|
322
|
+
"ListTaskQueuePartitions" => rpc_call!(connection, call, list_task_queue_partitions),
|
|
323
|
+
"ListWorkerDeployments" => rpc_call!(connection, call, list_worker_deployments),
|
|
324
|
+
"ListWorkers" => rpc_call!(connection, call, list_workers),
|
|
325
|
+
"ListWorkflowExecutions" => rpc_call!(connection, call, list_workflow_executions),
|
|
326
|
+
"ListWorkflowRules" => rpc_call!(connection, call, list_workflow_rules),
|
|
327
|
+
"PatchSchedule" => rpc_call!(connection, call, patch_schedule),
|
|
328
|
+
"PauseActivity" => rpc_call!(connection, call, pause_activity),
|
|
329
|
+
"PauseWorkflowExecution" => rpc_call!(connection, call, pause_workflow_execution),
|
|
330
|
+
"PollActivityExecution" => rpc_call!(connection, call, poll_activity_execution),
|
|
331
|
+
"PollActivityTaskQueue" => rpc_call!(connection, call, poll_activity_task_queue),
|
|
332
|
+
"PollNexusTaskQueue" => rpc_call!(connection, call, poll_nexus_task_queue),
|
|
403
333
|
"PollWorkflowExecutionUpdate" => {
|
|
404
|
-
rpc_call!(
|
|
334
|
+
rpc_call!(connection, call, poll_workflow_execution_update)
|
|
405
335
|
}
|
|
406
|
-
"PollWorkflowTaskQueue" =>
|
|
407
|
-
|
|
408
|
-
}
|
|
409
|
-
"QueryWorkflow" => rpc_call!(retry_client, call, query_workflow),
|
|
336
|
+
"PollWorkflowTaskQueue" => rpc_call!(connection, call, poll_workflow_task_queue),
|
|
337
|
+
"QueryWorkflow" => rpc_call!(connection, call, query_workflow),
|
|
410
338
|
"RecordActivityTaskHeartbeat" => {
|
|
411
|
-
rpc_call!(
|
|
339
|
+
rpc_call!(connection, call, record_activity_task_heartbeat)
|
|
412
340
|
}
|
|
413
341
|
"RecordActivityTaskHeartbeatById" => {
|
|
414
|
-
rpc_call!(
|
|
415
|
-
}
|
|
416
|
-
"RecordWorkerHeartbeat" => {
|
|
417
|
-
rpc_call!(retry_client, call, record_worker_heartbeat)
|
|
342
|
+
rpc_call!(connection, call, record_activity_task_heartbeat_by_id)
|
|
418
343
|
}
|
|
419
|
-
"
|
|
344
|
+
"RecordWorkerHeartbeat" => rpc_call!(connection, call, record_worker_heartbeat),
|
|
345
|
+
"RegisterNamespace" => rpc_call!(connection, call, register_namespace),
|
|
420
346
|
"RequestCancelActivityExecution" => {
|
|
421
|
-
rpc_call!(
|
|
347
|
+
rpc_call!(connection, call, request_cancel_activity_execution)
|
|
422
348
|
}
|
|
423
349
|
"RequestCancelWorkflowExecution" => {
|
|
424
|
-
rpc_call!(
|
|
425
|
-
}
|
|
426
|
-
"ResetActivity" => {
|
|
427
|
-
rpc_call!(retry_client, call, reset_activity)
|
|
428
|
-
}
|
|
429
|
-
"ResetStickyTaskQueue" => {
|
|
430
|
-
rpc_call!(retry_client, call, reset_sticky_task_queue)
|
|
431
|
-
}
|
|
432
|
-
"ResetWorkflowExecution" => {
|
|
433
|
-
rpc_call!(retry_client, call, reset_workflow_execution)
|
|
350
|
+
rpc_call!(connection, call, request_cancel_workflow_execution)
|
|
434
351
|
}
|
|
352
|
+
"ResetActivity" => rpc_call!(connection, call, reset_activity),
|
|
353
|
+
"ResetStickyTaskQueue" => rpc_call!(connection, call, reset_sticky_task_queue),
|
|
354
|
+
"ResetWorkflowExecution" => rpc_call!(connection, call, reset_workflow_execution),
|
|
435
355
|
"RespondActivityTaskCanceled" => {
|
|
436
|
-
rpc_call!(
|
|
356
|
+
rpc_call!(connection, call, respond_activity_task_canceled)
|
|
437
357
|
}
|
|
438
358
|
"RespondActivityTaskCanceledById" => {
|
|
439
|
-
rpc_call!(
|
|
359
|
+
rpc_call!(connection, call, respond_activity_task_canceled_by_id)
|
|
440
360
|
}
|
|
441
361
|
"RespondActivityTaskCompleted" => {
|
|
442
|
-
rpc_call!(
|
|
362
|
+
rpc_call!(connection, call, respond_activity_task_completed)
|
|
443
363
|
}
|
|
444
364
|
"RespondActivityTaskCompletedById" => {
|
|
445
|
-
rpc_call!(
|
|
446
|
-
}
|
|
447
|
-
"RespondActivityTaskFailed" => {
|
|
448
|
-
rpc_call!(retry_client, call, respond_activity_task_failed)
|
|
365
|
+
rpc_call!(connection, call, respond_activity_task_completed_by_id)
|
|
449
366
|
}
|
|
367
|
+
"RespondActivityTaskFailed" => rpc_call!(connection, call, respond_activity_task_failed),
|
|
450
368
|
"RespondActivityTaskFailedById" => {
|
|
451
|
-
rpc_call!(
|
|
452
|
-
}
|
|
453
|
-
"RespondNexusTaskCompleted" => {
|
|
454
|
-
rpc_call!(retry_client, call, respond_nexus_task_completed)
|
|
455
|
-
}
|
|
456
|
-
"RespondNexusTaskFailed" => {
|
|
457
|
-
rpc_call!(retry_client, call, respond_nexus_task_failed)
|
|
458
|
-
}
|
|
459
|
-
"RespondQueryTaskCompleted" => {
|
|
460
|
-
rpc_call!(retry_client, call, respond_query_task_completed)
|
|
369
|
+
rpc_call!(connection, call, respond_activity_task_failed_by_id)
|
|
461
370
|
}
|
|
371
|
+
"RespondNexusTaskCompleted" => rpc_call!(connection, call, respond_nexus_task_completed),
|
|
372
|
+
"RespondNexusTaskFailed" => rpc_call!(connection, call, respond_nexus_task_failed),
|
|
373
|
+
"RespondQueryTaskCompleted" => rpc_call!(connection, call, respond_query_task_completed),
|
|
462
374
|
"RespondWorkflowTaskCompleted" => {
|
|
463
|
-
rpc_call!(
|
|
464
|
-
}
|
|
465
|
-
"RespondWorkflowTaskFailed" => {
|
|
466
|
-
rpc_call!(retry_client, call, respond_workflow_task_failed)
|
|
467
|
-
}
|
|
468
|
-
"ScanWorkflowExecutions" => {
|
|
469
|
-
rpc_call!(retry_client, call, scan_workflow_executions)
|
|
470
|
-
}
|
|
471
|
-
"SetCurrentDeployment" => {
|
|
472
|
-
rpc_call!(retry_client, call, set_current_deployment)
|
|
375
|
+
rpc_call!(connection, call, respond_workflow_task_completed)
|
|
473
376
|
}
|
|
377
|
+
"RespondWorkflowTaskFailed" => rpc_call!(connection, call, respond_workflow_task_failed),
|
|
378
|
+
"ScanWorkflowExecutions" => rpc_call!(connection, call, scan_workflow_executions),
|
|
379
|
+
"SetCurrentDeployment" => rpc_call!(connection, call, set_current_deployment),
|
|
474
380
|
"SetWorkerDeploymentCurrentVersion" => {
|
|
475
|
-
rpc_call!(
|
|
476
|
-
}
|
|
477
|
-
"SetWorkerDeploymentManager" => {
|
|
478
|
-
rpc_call!(retry_client, call, set_worker_deployment_manager)
|
|
381
|
+
rpc_call!(connection, call, set_worker_deployment_current_version)
|
|
479
382
|
}
|
|
383
|
+
"SetWorkerDeploymentManager" => rpc_call!(connection, call, set_worker_deployment_manager),
|
|
480
384
|
"SetWorkerDeploymentRampingVersion" => {
|
|
481
|
-
rpc_call!(
|
|
482
|
-
}
|
|
483
|
-
"ShutdownWorker" => {
|
|
484
|
-
rpc_call!(retry_client, call, shutdown_worker)
|
|
385
|
+
rpc_call!(connection, call, set_worker_deployment_ramping_version)
|
|
485
386
|
}
|
|
387
|
+
"ShutdownWorker" => rpc_call!(connection, call, shutdown_worker),
|
|
486
388
|
"SignalWithStartWorkflowExecution" => {
|
|
487
|
-
rpc_call!(
|
|
488
|
-
}
|
|
489
|
-
"SignalWorkflowExecution" =>
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
"
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
"
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
"
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
"
|
|
502
|
-
|
|
503
|
-
}
|
|
504
|
-
"TerminateActivityExecution" => {
|
|
505
|
-
rpc_call!(retry_client, call, terminate_activity_execution)
|
|
506
|
-
}
|
|
507
|
-
"TerminateWorkflowExecution" => {
|
|
508
|
-
rpc_call!(retry_client, call, terminate_workflow_execution)
|
|
509
|
-
}
|
|
510
|
-
"TriggerWorkflowRule" => {
|
|
511
|
-
rpc_call!(retry_client, call, trigger_workflow_rule)
|
|
512
|
-
}
|
|
513
|
-
"UnpauseActivity" => {
|
|
514
|
-
rpc_call!(retry_client, call, unpause_activity)
|
|
515
|
-
}
|
|
516
|
-
"UnpauseWorkflowExecution" => {
|
|
517
|
-
rpc_call!(retry_client, call, unpause_workflow_execution)
|
|
518
|
-
}
|
|
519
|
-
"UpdateActivityOptions" => {
|
|
520
|
-
rpc_call!(retry_client, call, update_activity_options)
|
|
521
|
-
}
|
|
522
|
-
"UpdateNamespace" => {
|
|
523
|
-
rpc_call!(retry_client, call, update_namespace)
|
|
524
|
-
}
|
|
525
|
-
"UpdateSchedule" => rpc_call!(retry_client, call, update_schedule),
|
|
526
|
-
"UpdateWorkerConfig" => rpc_call!(retry_client, call, update_worker_config),
|
|
389
|
+
rpc_call!(connection, call, signal_with_start_workflow_execution)
|
|
390
|
+
}
|
|
391
|
+
"SignalWorkflowExecution" => rpc_call!(connection, call, signal_workflow_execution),
|
|
392
|
+
"StartActivityExecution" => rpc_call!(connection, call, start_activity_execution),
|
|
393
|
+
"StartWorkflowExecution" => rpc_call!(connection, call, start_workflow_execution),
|
|
394
|
+
"StartBatchOperation" => rpc_call!(connection, call, start_batch_operation),
|
|
395
|
+
"StopBatchOperation" => rpc_call!(connection, call, stop_batch_operation),
|
|
396
|
+
"TerminateActivityExecution" => rpc_call!(connection, call, terminate_activity_execution),
|
|
397
|
+
"TerminateWorkflowExecution" => rpc_call!(connection, call, terminate_workflow_execution),
|
|
398
|
+
"TriggerWorkflowRule" => rpc_call!(connection, call, trigger_workflow_rule),
|
|
399
|
+
"UnpauseActivity" => rpc_call!(connection, call, unpause_activity),
|
|
400
|
+
"UnpauseWorkflowExecution" => rpc_call!(connection, call, unpause_workflow_execution),
|
|
401
|
+
"UpdateActivityOptions" => rpc_call!(connection, call, update_activity_options),
|
|
402
|
+
"UpdateNamespace" => rpc_call!(connection, call, update_namespace),
|
|
403
|
+
"UpdateSchedule" => rpc_call!(connection, call, update_schedule),
|
|
404
|
+
"UpdateWorkerConfig" => rpc_call!(connection, call, update_worker_config),
|
|
527
405
|
"UpdateWorkerDeploymentVersionMetadata" => {
|
|
528
|
-
rpc_call!(
|
|
529
|
-
retry_client,
|
|
530
|
-
call,
|
|
531
|
-
update_worker_deployment_version_metadata
|
|
532
|
-
)
|
|
533
|
-
}
|
|
534
|
-
"UpdateTaskQueueConfig" => {
|
|
535
|
-
rpc_call!(retry_client, call, update_task_queue_config)
|
|
536
|
-
}
|
|
537
|
-
"UpdateWorkflowExecution" => {
|
|
538
|
-
rpc_call!(retry_client, call, update_workflow_execution)
|
|
406
|
+
rpc_call!(connection, call, update_worker_deployment_version_metadata)
|
|
539
407
|
}
|
|
408
|
+
"UpdateTaskQueueConfig" => rpc_call!(connection, call, update_task_queue_config),
|
|
409
|
+
"UpdateWorkflowExecution" => rpc_call!(connection, call, update_workflow_execution),
|
|
540
410
|
"UpdateWorkflowExecutionOptions" => {
|
|
541
|
-
rpc_call!(
|
|
411
|
+
rpc_call!(connection, call, update_workflow_execution_options)
|
|
542
412
|
}
|
|
543
413
|
"UpdateWorkerBuildIdCompatibility" => {
|
|
544
|
-
rpc_call!(
|
|
414
|
+
rpc_call!(connection, call, update_worker_build_id_compatibility)
|
|
545
415
|
}
|
|
546
416
|
"UpdateWorkerVersioningRules" => {
|
|
547
|
-
rpc_call!(
|
|
417
|
+
rpc_call!(connection, call, update_worker_versioning_rules)
|
|
548
418
|
}
|
|
549
419
|
_ => Err(BridgeError::TypeError {
|
|
550
420
|
field: None,
|
|
@@ -555,36 +425,47 @@ async fn client_invoke_workflow_service(
|
|
|
555
425
|
|
|
556
426
|
#[allow(clippy::cognitive_complexity)]
|
|
557
427
|
async fn client_invoke_operator_service(
|
|
558
|
-
mut
|
|
428
|
+
mut connection: Connection,
|
|
559
429
|
call: RpcCall,
|
|
560
430
|
) -> BridgeResult<Vec<u8>> {
|
|
561
|
-
use temporalio_client::OperatorService;
|
|
431
|
+
use temporalio_client::grpc::OperatorService;
|
|
562
432
|
|
|
563
433
|
match call.rpc.as_str() {
|
|
564
434
|
"AddOrUpdateRemoteCluster" => {
|
|
565
|
-
rpc_call!(
|
|
435
|
+
rpc_call!(
|
|
436
|
+
connection,
|
|
437
|
+
call,
|
|
438
|
+
add_or_update_remote_cluster,
|
|
439
|
+
operator_service
|
|
440
|
+
)
|
|
566
441
|
}
|
|
567
442
|
"AddSearchAttributes" => {
|
|
568
|
-
rpc_call!(
|
|
443
|
+
rpc_call!(connection, call, add_search_attributes, operator_service)
|
|
444
|
+
}
|
|
445
|
+
"CreateNexusEndpoint" => {
|
|
446
|
+
rpc_call!(connection, call, create_nexus_endpoint, operator_service)
|
|
569
447
|
}
|
|
570
|
-
"CreateNexusEndpoint" => rpc_call!(retry_client, call, create_nexus_endpoint),
|
|
571
448
|
"DeleteNamespace" => {
|
|
572
|
-
rpc_call!(
|
|
449
|
+
rpc_call!(connection, call, delete_namespace, operator_service)
|
|
450
|
+
}
|
|
451
|
+
"DeleteNexusEndpoint" => {
|
|
452
|
+
rpc_call!(connection, call, delete_nexus_endpoint, operator_service)
|
|
573
453
|
}
|
|
574
|
-
"
|
|
575
|
-
"
|
|
576
|
-
"
|
|
577
|
-
"ListNexusEndpoints" => rpc_call!(retry_client, call, list_nexus_endpoints),
|
|
454
|
+
"GetNexusEndpoint" => rpc_call!(connection, call, get_nexus_endpoint, operator_service),
|
|
455
|
+
"ListClusters" => rpc_call!(connection, call, list_clusters, operator_service),
|
|
456
|
+
"ListNexusEndpoints" => rpc_call!(connection, call, list_nexus_endpoints, operator_service),
|
|
578
457
|
"ListSearchAttributes" => {
|
|
579
|
-
rpc_call!(
|
|
458
|
+
rpc_call!(connection, call, list_search_attributes, operator_service)
|
|
580
459
|
}
|
|
581
460
|
"RemoveRemoteCluster" => {
|
|
582
|
-
rpc_call!(
|
|
461
|
+
rpc_call!(connection, call, remove_remote_cluster, operator_service)
|
|
583
462
|
}
|
|
584
463
|
"RemoveSearchAttributes" => {
|
|
585
|
-
rpc_call!(
|
|
464
|
+
rpc_call!(connection, call, remove_search_attributes, operator_service)
|
|
465
|
+
}
|
|
466
|
+
"UpdateNexusEndpoint" => {
|
|
467
|
+
rpc_call!(connection, call, update_nexus_endpoint, operator_service)
|
|
586
468
|
}
|
|
587
|
-
"UpdateNexusEndpoint" => rpc_call!(retry_client, call, update_nexus_endpoint),
|
|
588
469
|
_ => Err(BridgeError::TypeError {
|
|
589
470
|
field: None,
|
|
590
471
|
message: format!("Unknown RPC call {}", call.rpc),
|
|
@@ -593,20 +474,25 @@ async fn client_invoke_operator_service(
|
|
|
593
474
|
}
|
|
594
475
|
|
|
595
476
|
async fn client_invoke_test_service(
|
|
596
|
-
mut
|
|
477
|
+
mut connection: Connection,
|
|
597
478
|
call: RpcCall,
|
|
598
479
|
) -> BridgeResult<Vec<u8>> {
|
|
599
|
-
use temporalio_client::TestService;
|
|
480
|
+
use temporalio_client::grpc::TestService;
|
|
600
481
|
|
|
601
482
|
match call.rpc.as_str() {
|
|
602
|
-
"GetCurrentTime" => rpc_call!(
|
|
603
|
-
"LockTimeSkipping" => rpc_call!(
|
|
604
|
-
"SleepUntil" => rpc_call!(
|
|
605
|
-
"Sleep" => rpc_call!(
|
|
483
|
+
"GetCurrentTime" => rpc_call!(connection, call, get_current_time, test_service),
|
|
484
|
+
"LockTimeSkipping" => rpc_call!(connection, call, lock_time_skipping, test_service),
|
|
485
|
+
"SleepUntil" => rpc_call!(connection, call, sleep_until, test_service),
|
|
486
|
+
"Sleep" => rpc_call!(connection, call, sleep, test_service),
|
|
606
487
|
"UnlockTimeSkippingWithSleep" => {
|
|
607
|
-
rpc_call!(
|
|
488
|
+
rpc_call!(
|
|
489
|
+
connection,
|
|
490
|
+
call,
|
|
491
|
+
unlock_time_skipping_with_sleep,
|
|
492
|
+
test_service
|
|
493
|
+
)
|
|
608
494
|
}
|
|
609
|
-
"UnlockTimeSkipping" => rpc_call!(
|
|
495
|
+
"UnlockTimeSkipping" => rpc_call!(connection, call, unlock_time_skipping, test_service),
|
|
610
496
|
_ => Err(BridgeError::TypeError {
|
|
611
497
|
field: None,
|
|
612
498
|
message: format!("Unknown RPC call {}", call.rpc),
|
|
@@ -615,13 +501,13 @@ async fn client_invoke_test_service(
|
|
|
615
501
|
}
|
|
616
502
|
|
|
617
503
|
async fn client_invoke_health_service(
|
|
618
|
-
mut
|
|
504
|
+
mut connection: Connection,
|
|
619
505
|
call: RpcCall,
|
|
620
506
|
) -> BridgeResult<Vec<u8>> {
|
|
621
|
-
use temporalio_client::HealthService;
|
|
507
|
+
use temporalio_client::grpc::HealthService;
|
|
622
508
|
|
|
623
509
|
match call.rpc.as_str() {
|
|
624
|
-
"Check" => rpc_call!(
|
|
510
|
+
"Check" => rpc_call!(connection, call, check, health_service),
|
|
625
511
|
// Intentionally ignore 'watch' because it's a streaming method, which is not currently
|
|
626
512
|
// supported by the macro and client-side code, and not needed anyway for any SDK use case.
|
|
627
513
|
_ => Err(BridgeError::TypeError {
|
|
@@ -686,15 +572,16 @@ where
|
|
|
686
572
|
mod config {
|
|
687
573
|
use std::collections::HashMap;
|
|
688
574
|
|
|
689
|
-
use temporalio_client::
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
TlsOptions as CoreTlsOptions, Url,
|
|
575
|
+
use temporalio_client::{
|
|
576
|
+
ClientTlsOptions as CoreClientTlsOptions, ConnectionOptions, HttpConnectProxyOptions,
|
|
577
|
+
TlsOptions as CoreTlsOptions,
|
|
693
578
|
};
|
|
579
|
+
use temporalio_common::telemetry::metrics::TemporalMeter;
|
|
580
|
+
use temporalio_sdk_core::Url;
|
|
694
581
|
|
|
695
582
|
use bridge_macros::TryFromJs;
|
|
696
583
|
|
|
697
|
-
use crate::
|
|
584
|
+
use crate::client::MetadataValue;
|
|
698
585
|
|
|
699
586
|
#[derive(Debug, Clone, TryFromJs)]
|
|
700
587
|
pub(super) struct ClientOptions {
|
|
@@ -734,13 +621,14 @@ mod config {
|
|
|
734
621
|
password: String,
|
|
735
622
|
}
|
|
736
623
|
|
|
737
|
-
impl
|
|
738
|
-
|
|
739
|
-
|
|
624
|
+
impl ClientOptions {
|
|
625
|
+
pub(super) fn into_connection_options(
|
|
626
|
+
self,
|
|
627
|
+
metrics_meter: Option<TemporalMeter>,
|
|
628
|
+
) -> ConnectionOptions {
|
|
740
629
|
let (ascii_headers, bin_headers) = partition_headers(self.headers);
|
|
741
630
|
|
|
742
|
-
|
|
743
|
-
.target_url(self.target_url)
|
|
631
|
+
ConnectionOptions::new(self.target_url)
|
|
744
632
|
.client_name(self.client_name)
|
|
745
633
|
.client_version(self.client_version)
|
|
746
634
|
.maybe_tls_options(self.tls.map(Into::into))
|
|
@@ -748,15 +636,14 @@ mod config {
|
|
|
748
636
|
.maybe_headers(ascii_headers)
|
|
749
637
|
.maybe_binary_headers(bin_headers)
|
|
750
638
|
.maybe_api_key(self.api_key)
|
|
639
|
+
.maybe_metrics_meter(metrics_meter)
|
|
751
640
|
.disable_error_code_metric_tags(self.disable_error_code_metric_tags)
|
|
752
641
|
// identity -- skipped: will be set on worker
|
|
753
642
|
// retry_config -- skipped: worker overrides anyway
|
|
754
643
|
// override_origin -- skipped: will default to tls_cfg.domain
|
|
755
644
|
// keep_alive -- skipped: defaults to true; is there any reason to disable this?
|
|
756
645
|
// skip_get_system_info -- skipped: defaults to false; is there any reason to set this?
|
|
757
|
-
.build()
|
|
758
|
-
|
|
759
|
-
Ok(client_options)
|
|
646
|
+
.build()
|
|
760
647
|
}
|
|
761
648
|
}
|
|
762
649
|
|