@temporalio/core-bridge 1.14.2-canary-release-testing.0 → 1.16.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.
- package/Cargo.lock +794 -650
- package/bridge-macros/src/derive_tryintojs.rs +40 -0
- package/lib/native.d.ts +24 -3
- package/package.json +4 -4
- 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 +42 -31
- package/sdk-core/Cargo.toml +4 -1
- package/sdk-core/README.md +19 -13
- 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} +370 -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} +104 -29
- package/sdk-core/crates/client/src/workflow_handle.rs +826 -0
- package/sdk-core/crates/common/Cargo.toml +62 -3
- 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/.github/workflows/create-release.yml +0 -5
- package/sdk-core/crates/common/protos/api_upstream/Makefile +2 -1
- package/sdk-core/crates/common/protos/api_upstream/README.md +8 -0
- 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 +3329 -2647
- package/sdk-core/crates/common/protos/api_upstream/openapi/openapiv3.yaml +2734 -708
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/activity/v1/message.proto +155 -3
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/command/v1/message.proto +26 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/common/v1/message.proto +8 -1
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/deployment/v1/message.proto +27 -1
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/enums/v1/activity.proto +81 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/enums/v1/event_type.proto +4 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/enums/v1/failed_cause.proto +4 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/enums/v1/task_queue.proto +15 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/enums/v1/workflow.proto +63 -15
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/errordetails/v1/message.proto +8 -0
- 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 +111 -17
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/namespace/v1/message.proto +21 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/nexus/v1/message.proto +20 -1
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/operatorservice/v1/request_response.proto +4 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/schedule/v1/message.proto +2 -2
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/taskqueue/v1/message.proto +2 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/worker/v1/message.proto +4 -7
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/workflow/v1/message.proto +80 -22
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +347 -23
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +242 -43
- package/sdk-core/crates/common/protos/local/temporal/sdk/core/core_interface.proto +15 -0
- package/sdk-core/crates/common/protos/local/temporal/sdk/core/nexus/nexus.proto +9 -2
- package/sdk-core/crates/common/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +8 -0
- package/sdk-core/crates/common/protos/local/temporal/sdk/core/workflow_commands/workflow_commands.proto +22 -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 +19 -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 +134 -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 +11 -16
- package/sdk-core/crates/common/src/telemetry/metrics/core.rs +125 -0
- package/sdk-core/crates/common/src/telemetry/metrics.rs +272 -225
- 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 +278 -19
- package/sdk-core/crates/common/src/worker.rs +68 -636
- 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 +759 -442
- package/sdk-core/crates/sdk/src/workflow_context/options.rs +64 -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 +59 -65
- package/sdk-core/crates/sdk-core/benches/workflow_replay_bench.rs +45 -54
- 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 +22 -21
- 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 +647 -27
- package/sdk-core/crates/sdk-core/src/core_tests/workflow_tasks.rs +46 -41
- package/sdk-core/crates/sdk-core/src/ephemeral_server/mod.rs +13 -16
- package/sdk-core/crates/sdk-core/src/histfetch.rs +20 -10
- package/sdk-core/crates/sdk-core/src/lib.rs +60 -123
- package/sdk-core/crates/sdk-core/src/pollers/mod.rs +4 -9
- package/sdk-core/crates/sdk-core/src/pollers/poll_buffer.rs +411 -32
- 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 +183 -198
- package/sdk-core/crates/sdk-core/src/telemetry/mod.rs +3 -281
- package/sdk-core/crates/sdk-core/src/test_help/integ_helpers.rs +35 -16
- package/sdk-core/crates/sdk-core/src/test_help/unit_helpers.rs +3 -6
- package/sdk-core/crates/sdk-core/src/worker/activities/activity_heartbeat_manager.rs +1 -0
- 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 +11 -5
- package/sdk-core/crates/sdk-core/src/worker/client.rs +104 -86
- package/sdk-core/crates/sdk-core/src/worker/heartbeat.rs +10 -14
- package/sdk-core/crates/sdk-core/src/worker/mod.rs +1175 -241
- package/sdk-core/crates/sdk-core/src/worker/nexus.rs +150 -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 +25 -27
- package/sdk-core/crates/sdk-core/src/worker/tuner.rs +64 -44
- package/sdk-core/crates/sdk-core/src/worker/workflow/driven_workflow.rs +9 -3
- package/sdk-core/crates/sdk-core/src/worker/workflow/machines/patch_state_machine.rs +5 -8
- 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 +28 -4
- package/sdk-core/crates/sdk-core/src/worker/workflow/managed_run.rs +20 -41
- package/sdk-core/crates/sdk-core/src/worker/workflow/mod.rs +50 -9
- 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 +281 -236
- package/sdk-core/crates/sdk-core/tests/common/workflows.rs +41 -28
- package/sdk-core/crates/sdk-core/tests/global_metric_tests.rs +9 -14
- package/sdk-core/crates/sdk-core/tests/heavy_tests/fuzzy_workflow.rs +73 -66
- package/sdk-core/crates/sdk-core/tests/heavy_tests.rs +306 -268
- 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 +37 -38
- package/sdk-core/crates/sdk-core/tests/integ_tests/heartbeat_tests.rs +49 -40
- package/sdk-core/crates/sdk-core/tests/integ_tests/metrics_tests.rs +447 -300
- 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 +157 -157
- 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 -463
- 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 +389 -265
- package/sdk-core/crates/sdk-core/tests/integ_tests/worker_tests.rs +250 -185
- package/sdk-core/crates/sdk-core/tests/integ_tests/worker_versioning_tests.rs +52 -49
- 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 +437 -327
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/cancel_external.rs +82 -58
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/cancel_wf.rs +56 -30
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/child_workflows.rs +364 -251
- 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 +110 -46
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/determinism.rs +243 -149
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/eager.rs +98 -32
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/local_activities.rs +1475 -1040
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/modify_wf_properties.rs +73 -43
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/nexus.rs +402 -245
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/patches.rs +343 -207
- 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 +155 -140
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/signals.rs +183 -113
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/stickyness.rs +85 -44
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/timers.rs +142 -48
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/upsert_search_attrs.rs +73 -56
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests.rs +365 -242
- package/sdk-core/crates/sdk-core/tests/main.rs +22 -16
- package/sdk-core/crates/sdk-core/tests/manual_tests.rs +233 -187
- package/sdk-core/crates/sdk-core/tests/runner.rs +4 -6
- package/sdk-core/crates/sdk-core/tests/shared_tests/mod.rs +73 -27
- 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 +8 -1
- package/sdk-core/crates/sdk-core-c-bridge/include/temporal-sdk-core-c-bridge.h +37 -26
- package/sdk-core/crates/sdk-core-c-bridge/src/client.rs +180 -87
- package/sdk-core/crates/sdk-core-c-bridge/src/lib.rs +89 -5
- package/sdk-core/crates/sdk-core-c-bridge/src/metric.rs +10 -16
- package/sdk-core/crates/sdk-core-c-bridge/src/runtime.rs +59 -67
- package/sdk-core/crates/sdk-core-c-bridge/src/testing.rs +10 -10
- package/sdk-core/crates/sdk-core-c-bridge/src/tests/context.rs +57 -22
- package/sdk-core/crates/sdk-core-c-bridge/src/tests/mod.rs +108 -12
- package/sdk-core/crates/sdk-core-c-bridge/src/tests/utils.rs +9 -52
- package/sdk-core/crates/sdk-core-c-bridge/src/worker.rs +74 -91
- package/sdk-core/rustfmt.toml +2 -1
- package/src/client.rs +206 -289
- package/src/helpers/try_into_js.rs +88 -2
- package/src/metrics.rs +277 -35
- package/src/runtime.rs +94 -45
- package/src/testing.rs +9 -16
- package/src/worker.rs +86 -68
- package/ts/native.ts +39 -3
- 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/macros/LICENSE.txt +0 -21
- 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,267 +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
|
-
"
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
"CreateSchedule" =>
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
"
|
|
270
|
-
|
|
271
|
-
}
|
|
272
|
-
"DeleteSchedule" => {
|
|
273
|
-
rpc_call!(retry_client, call, delete_schedule)
|
|
274
|
-
}
|
|
275
|
-
"DeleteWorkerDeployment" => {
|
|
276
|
-
rpc_call!(retry_client, call, delete_worker_deployment)
|
|
277
|
-
}
|
|
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),
|
|
278
272
|
"DeleteWorkerDeploymentVersion" => {
|
|
279
|
-
rpc_call!(
|
|
280
|
-
}
|
|
281
|
-
"DeleteWorkflowExecution" =>
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
"
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
"
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
"
|
|
291
|
-
|
|
292
|
-
}
|
|
293
|
-
"DescribeWorker" => {
|
|
294
|
-
rpc_call!(retry_client, call, describe_worker)
|
|
295
|
-
}
|
|
296
|
-
"DeprecateNamespace" => rpc_call!(retry_client, call, deprecate_namespace),
|
|
297
|
-
"DescribeNamespace" => rpc_call!(retry_client, call, describe_namespace),
|
|
298
|
-
"DescribeSchedule" => rpc_call!(retry_client, call, describe_schedule),
|
|
299
|
-
"DescribeTaskQueue" => rpc_call!(retry_client, call, describe_task_queue),
|
|
300
|
-
"DescribeWorkerDeployment" => {
|
|
301
|
-
rpc_call!(retry_client, call, describe_worker_deployment)
|
|
302
|
-
}
|
|
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),
|
|
303
286
|
"DescribeWorkerDeploymentVersion" => {
|
|
304
|
-
rpc_call!(
|
|
305
|
-
}
|
|
306
|
-
"DescribeWorkflowExecution" =>
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
"
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
"
|
|
313
|
-
"
|
|
314
|
-
"
|
|
315
|
-
"GetCurrentDeployment" => rpc_call!(retry_client, call, get_current_deployment),
|
|
316
|
-
"GetDeploymentReachability" => {
|
|
317
|
-
rpc_call!(retry_client, call, get_deployment_reachability)
|
|
318
|
-
}
|
|
319
|
-
"GetSearchAttributes" => {
|
|
320
|
-
rpc_call!(retry_client, call, get_search_attributes)
|
|
321
|
-
}
|
|
322
|
-
"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),
|
|
323
298
|
"GetWorkerBuildIdCompatibility" => {
|
|
324
|
-
rpc_call!(
|
|
325
|
-
}
|
|
326
|
-
"GetWorkerTaskReachability" => {
|
|
327
|
-
rpc_call!(retry_client, call, get_worker_task_reachability)
|
|
328
|
-
}
|
|
329
|
-
"GetWorkerVersioningRules" => {
|
|
330
|
-
rpc_call!(retry_client, call, get_worker_versioning_rules)
|
|
299
|
+
rpc_call!(connection, call, get_worker_build_id_compatibility)
|
|
331
300
|
}
|
|
301
|
+
"GetWorkerTaskReachability" => rpc_call!(connection, call, get_worker_task_reachability),
|
|
302
|
+
"GetWorkerVersioningRules" => rpc_call!(connection, call, get_worker_versioning_rules),
|
|
332
303
|
"GetWorkflowExecutionHistory" => {
|
|
333
|
-
rpc_call!(
|
|
304
|
+
rpc_call!(connection, call, get_workflow_execution_history)
|
|
334
305
|
}
|
|
335
306
|
"GetWorkflowExecutionHistoryReverse" => {
|
|
336
|
-
rpc_call!(
|
|
307
|
+
rpc_call!(connection, call, get_workflow_execution_history_reverse)
|
|
337
308
|
}
|
|
338
309
|
"ListArchivedWorkflowExecutions" => {
|
|
339
|
-
rpc_call!(
|
|
340
|
-
}
|
|
341
|
-
"ListBatchOperations" => {
|
|
342
|
-
rpc_call!(retry_client, call, list_batch_operations)
|
|
310
|
+
rpc_call!(connection, call, list_archived_workflow_executions)
|
|
343
311
|
}
|
|
312
|
+
"ListActivityExecutions" => rpc_call!(connection, call, list_activity_executions),
|
|
313
|
+
"ListBatchOperations" => rpc_call!(connection, call, list_batch_operations),
|
|
344
314
|
"ListClosedWorkflowExecutions" => {
|
|
345
|
-
rpc_call!(
|
|
346
|
-
}
|
|
347
|
-
"ListDeployments" =>
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
"
|
|
351
|
-
"
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
"
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
"
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
"
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
"ListWorkerDeployments" => {
|
|
364
|
-
rpc_call!(retry_client, call, list_worker_deployments)
|
|
365
|
-
}
|
|
366
|
-
"ListWorkers" => {
|
|
367
|
-
rpc_call!(retry_client, call, list_workers)
|
|
368
|
-
}
|
|
369
|
-
"ListWorkflowExecutions" => {
|
|
370
|
-
rpc_call!(retry_client, call, list_workflow_executions)
|
|
371
|
-
}
|
|
372
|
-
"ListWorkflowRules" => {
|
|
373
|
-
rpc_call!(retry_client, call, list_workflow_rules)
|
|
374
|
-
}
|
|
375
|
-
"PatchSchedule" => {
|
|
376
|
-
rpc_call!(retry_client, call, patch_schedule)
|
|
377
|
-
}
|
|
378
|
-
"PauseActivity" => {
|
|
379
|
-
rpc_call!(retry_client, call, pause_activity)
|
|
380
|
-
}
|
|
381
|
-
"PollActivityTaskQueue" => {
|
|
382
|
-
rpc_call!(retry_client, call, poll_activity_task_queue)
|
|
383
|
-
}
|
|
384
|
-
"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),
|
|
385
333
|
"PollWorkflowExecutionUpdate" => {
|
|
386
|
-
rpc_call!(
|
|
387
|
-
}
|
|
388
|
-
"PollWorkflowTaskQueue" => {
|
|
389
|
-
rpc_call!(retry_client, call, poll_workflow_task_queue)
|
|
334
|
+
rpc_call!(connection, call, poll_workflow_execution_update)
|
|
390
335
|
}
|
|
391
|
-
"
|
|
336
|
+
"PollWorkflowTaskQueue" => rpc_call!(connection, call, poll_workflow_task_queue),
|
|
337
|
+
"QueryWorkflow" => rpc_call!(connection, call, query_workflow),
|
|
392
338
|
"RecordActivityTaskHeartbeat" => {
|
|
393
|
-
rpc_call!(
|
|
339
|
+
rpc_call!(connection, call, record_activity_task_heartbeat)
|
|
394
340
|
}
|
|
395
341
|
"RecordActivityTaskHeartbeatById" => {
|
|
396
|
-
rpc_call!(
|
|
342
|
+
rpc_call!(connection, call, record_activity_task_heartbeat_by_id)
|
|
397
343
|
}
|
|
398
|
-
"RecordWorkerHeartbeat" =>
|
|
399
|
-
|
|
344
|
+
"RecordWorkerHeartbeat" => rpc_call!(connection, call, record_worker_heartbeat),
|
|
345
|
+
"RegisterNamespace" => rpc_call!(connection, call, register_namespace),
|
|
346
|
+
"RequestCancelActivityExecution" => {
|
|
347
|
+
rpc_call!(connection, call, request_cancel_activity_execution)
|
|
400
348
|
}
|
|
401
|
-
"RegisterNamespace" => rpc_call!(retry_client, call, register_namespace),
|
|
402
349
|
"RequestCancelWorkflowExecution" => {
|
|
403
|
-
rpc_call!(
|
|
404
|
-
}
|
|
405
|
-
"ResetActivity" => {
|
|
406
|
-
rpc_call!(retry_client, call, reset_activity)
|
|
407
|
-
}
|
|
408
|
-
"ResetStickyTaskQueue" => {
|
|
409
|
-
rpc_call!(retry_client, call, reset_sticky_task_queue)
|
|
410
|
-
}
|
|
411
|
-
"ResetWorkflowExecution" => {
|
|
412
|
-
rpc_call!(retry_client, call, reset_workflow_execution)
|
|
350
|
+
rpc_call!(connection, call, request_cancel_workflow_execution)
|
|
413
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),
|
|
414
355
|
"RespondActivityTaskCanceled" => {
|
|
415
|
-
rpc_call!(
|
|
356
|
+
rpc_call!(connection, call, respond_activity_task_canceled)
|
|
416
357
|
}
|
|
417
358
|
"RespondActivityTaskCanceledById" => {
|
|
418
|
-
rpc_call!(
|
|
359
|
+
rpc_call!(connection, call, respond_activity_task_canceled_by_id)
|
|
419
360
|
}
|
|
420
361
|
"RespondActivityTaskCompleted" => {
|
|
421
|
-
rpc_call!(
|
|
362
|
+
rpc_call!(connection, call, respond_activity_task_completed)
|
|
422
363
|
}
|
|
423
364
|
"RespondActivityTaskCompletedById" => {
|
|
424
|
-
rpc_call!(
|
|
425
|
-
}
|
|
426
|
-
"RespondActivityTaskFailed" => {
|
|
427
|
-
rpc_call!(retry_client, call, respond_activity_task_failed)
|
|
365
|
+
rpc_call!(connection, call, respond_activity_task_completed_by_id)
|
|
428
366
|
}
|
|
367
|
+
"RespondActivityTaskFailed" => rpc_call!(connection, call, respond_activity_task_failed),
|
|
429
368
|
"RespondActivityTaskFailedById" => {
|
|
430
|
-
rpc_call!(
|
|
431
|
-
}
|
|
432
|
-
"RespondNexusTaskCompleted" => {
|
|
433
|
-
rpc_call!(retry_client, call, respond_nexus_task_completed)
|
|
434
|
-
}
|
|
435
|
-
"RespondNexusTaskFailed" => {
|
|
436
|
-
rpc_call!(retry_client, call, respond_nexus_task_failed)
|
|
437
|
-
}
|
|
438
|
-
"RespondQueryTaskCompleted" => {
|
|
439
|
-
rpc_call!(retry_client, call, respond_query_task_completed)
|
|
369
|
+
rpc_call!(connection, call, respond_activity_task_failed_by_id)
|
|
440
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),
|
|
441
374
|
"RespondWorkflowTaskCompleted" => {
|
|
442
|
-
rpc_call!(
|
|
443
|
-
}
|
|
444
|
-
"RespondWorkflowTaskFailed" => {
|
|
445
|
-
rpc_call!(retry_client, call, respond_workflow_task_failed)
|
|
446
|
-
}
|
|
447
|
-
"ScanWorkflowExecutions" => {
|
|
448
|
-
rpc_call!(retry_client, call, scan_workflow_executions)
|
|
449
|
-
}
|
|
450
|
-
"SetCurrentDeployment" => {
|
|
451
|
-
rpc_call!(retry_client, call, set_current_deployment)
|
|
375
|
+
rpc_call!(connection, call, respond_workflow_task_completed)
|
|
452
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),
|
|
453
380
|
"SetWorkerDeploymentCurrentVersion" => {
|
|
454
|
-
rpc_call!(
|
|
455
|
-
}
|
|
456
|
-
"SetWorkerDeploymentManager" => {
|
|
457
|
-
rpc_call!(retry_client, call, set_worker_deployment_manager)
|
|
381
|
+
rpc_call!(connection, call, set_worker_deployment_current_version)
|
|
458
382
|
}
|
|
383
|
+
"SetWorkerDeploymentManager" => rpc_call!(connection, call, set_worker_deployment_manager),
|
|
459
384
|
"SetWorkerDeploymentRampingVersion" => {
|
|
460
|
-
rpc_call!(
|
|
461
|
-
}
|
|
462
|
-
"ShutdownWorker" => {
|
|
463
|
-
rpc_call!(retry_client, call, shutdown_worker)
|
|
385
|
+
rpc_call!(connection, call, set_worker_deployment_ramping_version)
|
|
464
386
|
}
|
|
387
|
+
"ShutdownWorker" => rpc_call!(connection, call, shutdown_worker),
|
|
465
388
|
"SignalWithStartWorkflowExecution" => {
|
|
466
|
-
rpc_call!(
|
|
467
|
-
}
|
|
468
|
-
"SignalWorkflowExecution" =>
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
"
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
"
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
"
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
"
|
|
481
|
-
|
|
482
|
-
}
|
|
483
|
-
"TriggerWorkflowRule" => {
|
|
484
|
-
rpc_call!(retry_client, call, trigger_workflow_rule)
|
|
485
|
-
}
|
|
486
|
-
"UnpauseActivity" => {
|
|
487
|
-
rpc_call!(retry_client, call, unpause_activity)
|
|
488
|
-
}
|
|
489
|
-
"UpdateActivityOptions" => {
|
|
490
|
-
rpc_call!(retry_client, call, update_activity_options)
|
|
491
|
-
}
|
|
492
|
-
"UpdateNamespace" => {
|
|
493
|
-
rpc_call!(retry_client, call, update_namespace)
|
|
494
|
-
}
|
|
495
|
-
"UpdateSchedule" => rpc_call!(retry_client, call, update_schedule),
|
|
496
|
-
"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),
|
|
497
405
|
"UpdateWorkerDeploymentVersionMetadata" => {
|
|
498
|
-
rpc_call!(
|
|
499
|
-
retry_client,
|
|
500
|
-
call,
|
|
501
|
-
update_worker_deployment_version_metadata
|
|
502
|
-
)
|
|
503
|
-
}
|
|
504
|
-
"UpdateTaskQueueConfig" => {
|
|
505
|
-
rpc_call!(retry_client, call, update_task_queue_config)
|
|
506
|
-
}
|
|
507
|
-
"UpdateWorkflowExecution" => {
|
|
508
|
-
rpc_call!(retry_client, call, update_workflow_execution)
|
|
406
|
+
rpc_call!(connection, call, update_worker_deployment_version_metadata)
|
|
509
407
|
}
|
|
408
|
+
"UpdateTaskQueueConfig" => rpc_call!(connection, call, update_task_queue_config),
|
|
409
|
+
"UpdateWorkflowExecution" => rpc_call!(connection, call, update_workflow_execution),
|
|
510
410
|
"UpdateWorkflowExecutionOptions" => {
|
|
511
|
-
rpc_call!(
|
|
411
|
+
rpc_call!(connection, call, update_workflow_execution_options)
|
|
512
412
|
}
|
|
513
413
|
"UpdateWorkerBuildIdCompatibility" => {
|
|
514
|
-
rpc_call!(
|
|
414
|
+
rpc_call!(connection, call, update_worker_build_id_compatibility)
|
|
515
415
|
}
|
|
516
416
|
"UpdateWorkerVersioningRules" => {
|
|
517
|
-
rpc_call!(
|
|
417
|
+
rpc_call!(connection, call, update_worker_versioning_rules)
|
|
518
418
|
}
|
|
519
419
|
_ => Err(BridgeError::TypeError {
|
|
520
420
|
field: None,
|
|
@@ -525,36 +425,47 @@ async fn client_invoke_workflow_service(
|
|
|
525
425
|
|
|
526
426
|
#[allow(clippy::cognitive_complexity)]
|
|
527
427
|
async fn client_invoke_operator_service(
|
|
528
|
-
mut
|
|
428
|
+
mut connection: Connection,
|
|
529
429
|
call: RpcCall,
|
|
530
430
|
) -> BridgeResult<Vec<u8>> {
|
|
531
|
-
use temporalio_client::OperatorService;
|
|
431
|
+
use temporalio_client::grpc::OperatorService;
|
|
532
432
|
|
|
533
433
|
match call.rpc.as_str() {
|
|
534
434
|
"AddOrUpdateRemoteCluster" => {
|
|
535
|
-
rpc_call!(
|
|
435
|
+
rpc_call!(
|
|
436
|
+
connection,
|
|
437
|
+
call,
|
|
438
|
+
add_or_update_remote_cluster,
|
|
439
|
+
operator_service
|
|
440
|
+
)
|
|
536
441
|
}
|
|
537
442
|
"AddSearchAttributes" => {
|
|
538
|
-
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)
|
|
539
447
|
}
|
|
540
|
-
"CreateNexusEndpoint" => rpc_call!(retry_client, call, create_nexus_endpoint),
|
|
541
448
|
"DeleteNamespace" => {
|
|
542
|
-
rpc_call!(
|
|
449
|
+
rpc_call!(connection, call, delete_namespace, operator_service)
|
|
450
|
+
}
|
|
451
|
+
"DeleteNexusEndpoint" => {
|
|
452
|
+
rpc_call!(connection, call, delete_nexus_endpoint, operator_service)
|
|
543
453
|
}
|
|
544
|
-
"
|
|
545
|
-
"
|
|
546
|
-
"
|
|
547
|
-
"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),
|
|
548
457
|
"ListSearchAttributes" => {
|
|
549
|
-
rpc_call!(
|
|
458
|
+
rpc_call!(connection, call, list_search_attributes, operator_service)
|
|
550
459
|
}
|
|
551
460
|
"RemoveRemoteCluster" => {
|
|
552
|
-
rpc_call!(
|
|
461
|
+
rpc_call!(connection, call, remove_remote_cluster, operator_service)
|
|
553
462
|
}
|
|
554
463
|
"RemoveSearchAttributes" => {
|
|
555
|
-
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)
|
|
556
468
|
}
|
|
557
|
-
"UpdateNexusEndpoint" => rpc_call!(retry_client, call, update_nexus_endpoint),
|
|
558
469
|
_ => Err(BridgeError::TypeError {
|
|
559
470
|
field: None,
|
|
560
471
|
message: format!("Unknown RPC call {}", call.rpc),
|
|
@@ -563,20 +474,25 @@ async fn client_invoke_operator_service(
|
|
|
563
474
|
}
|
|
564
475
|
|
|
565
476
|
async fn client_invoke_test_service(
|
|
566
|
-
mut
|
|
477
|
+
mut connection: Connection,
|
|
567
478
|
call: RpcCall,
|
|
568
479
|
) -> BridgeResult<Vec<u8>> {
|
|
569
|
-
use temporalio_client::TestService;
|
|
480
|
+
use temporalio_client::grpc::TestService;
|
|
570
481
|
|
|
571
482
|
match call.rpc.as_str() {
|
|
572
|
-
"GetCurrentTime" => rpc_call!(
|
|
573
|
-
"LockTimeSkipping" => rpc_call!(
|
|
574
|
-
"SleepUntil" => rpc_call!(
|
|
575
|
-
"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),
|
|
576
487
|
"UnlockTimeSkippingWithSleep" => {
|
|
577
|
-
rpc_call!(
|
|
488
|
+
rpc_call!(
|
|
489
|
+
connection,
|
|
490
|
+
call,
|
|
491
|
+
unlock_time_skipping_with_sleep,
|
|
492
|
+
test_service
|
|
493
|
+
)
|
|
578
494
|
}
|
|
579
|
-
"UnlockTimeSkipping" => rpc_call!(
|
|
495
|
+
"UnlockTimeSkipping" => rpc_call!(connection, call, unlock_time_skipping, test_service),
|
|
580
496
|
_ => Err(BridgeError::TypeError {
|
|
581
497
|
field: None,
|
|
582
498
|
message: format!("Unknown RPC call {}", call.rpc),
|
|
@@ -585,13 +501,13 @@ async fn client_invoke_test_service(
|
|
|
585
501
|
}
|
|
586
502
|
|
|
587
503
|
async fn client_invoke_health_service(
|
|
588
|
-
mut
|
|
504
|
+
mut connection: Connection,
|
|
589
505
|
call: RpcCall,
|
|
590
506
|
) -> BridgeResult<Vec<u8>> {
|
|
591
|
-
use temporalio_client::HealthService;
|
|
507
|
+
use temporalio_client::grpc::HealthService;
|
|
592
508
|
|
|
593
509
|
match call.rpc.as_str() {
|
|
594
|
-
"Check" => rpc_call!(
|
|
510
|
+
"Check" => rpc_call!(connection, call, check, health_service),
|
|
595
511
|
// Intentionally ignore 'watch' because it's a streaming method, which is not currently
|
|
596
512
|
// supported by the macro and client-side code, and not needed anyway for any SDK use case.
|
|
597
513
|
_ => Err(BridgeError::TypeError {
|
|
@@ -656,15 +572,16 @@ where
|
|
|
656
572
|
mod config {
|
|
657
573
|
use std::collections::HashMap;
|
|
658
574
|
|
|
659
|
-
use temporalio_client::
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
TlsOptions as CoreTlsOptions, Url,
|
|
575
|
+
use temporalio_client::{
|
|
576
|
+
ClientTlsOptions as CoreClientTlsOptions, ConnectionOptions, HttpConnectProxyOptions,
|
|
577
|
+
TlsOptions as CoreTlsOptions,
|
|
663
578
|
};
|
|
579
|
+
use temporalio_common::telemetry::metrics::TemporalMeter;
|
|
580
|
+
use temporalio_sdk_core::Url;
|
|
664
581
|
|
|
665
582
|
use bridge_macros::TryFromJs;
|
|
666
583
|
|
|
667
|
-
use crate::
|
|
584
|
+
use crate::client::MetadataValue;
|
|
668
585
|
|
|
669
586
|
#[derive(Debug, Clone, TryFromJs)]
|
|
670
587
|
pub(super) struct ClientOptions {
|
|
@@ -704,13 +621,14 @@ mod config {
|
|
|
704
621
|
password: String,
|
|
705
622
|
}
|
|
706
623
|
|
|
707
|
-
impl
|
|
708
|
-
|
|
709
|
-
|
|
624
|
+
impl ClientOptions {
|
|
625
|
+
pub(super) fn into_connection_options(
|
|
626
|
+
self,
|
|
627
|
+
metrics_meter: Option<TemporalMeter>,
|
|
628
|
+
) -> ConnectionOptions {
|
|
710
629
|
let (ascii_headers, bin_headers) = partition_headers(self.headers);
|
|
711
630
|
|
|
712
|
-
|
|
713
|
-
.target_url(self.target_url)
|
|
631
|
+
ConnectionOptions::new(self.target_url)
|
|
714
632
|
.client_name(self.client_name)
|
|
715
633
|
.client_version(self.client_version)
|
|
716
634
|
.maybe_tls_options(self.tls.map(Into::into))
|
|
@@ -718,15 +636,14 @@ mod config {
|
|
|
718
636
|
.maybe_headers(ascii_headers)
|
|
719
637
|
.maybe_binary_headers(bin_headers)
|
|
720
638
|
.maybe_api_key(self.api_key)
|
|
639
|
+
.maybe_metrics_meter(metrics_meter)
|
|
721
640
|
.disable_error_code_metric_tags(self.disable_error_code_metric_tags)
|
|
722
641
|
// identity -- skipped: will be set on worker
|
|
723
642
|
// retry_config -- skipped: worker overrides anyway
|
|
724
643
|
// override_origin -- skipped: will default to tls_cfg.domain
|
|
725
644
|
// keep_alive -- skipped: defaults to true; is there any reason to disable this?
|
|
726
645
|
// skip_get_system_info -- skipped: defaults to false; is there any reason to set this?
|
|
727
|
-
.build()
|
|
728
|
-
|
|
729
|
-
Ok(client_options)
|
|
646
|
+
.build()
|
|
730
647
|
}
|
|
731
648
|
}
|
|
732
649
|
|