@temporalio/core-bridge 1.13.2 → 1.14.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 +135 -100
- package/Cargo.toml +3 -2
- package/{sdk-core/fsm/rustfsm_trait/LICENSE.txt → LICENSE} +5 -5
- package/README.md +0 -1
- package/bridge-macros/Cargo.toml +16 -0
- package/bridge-macros/src/derive_js_function.rs +126 -0
- package/bridge-macros/src/derive_tryfromjs.rs +138 -0
- package/bridge-macros/src/derive_tryintojs.rs +151 -0
- package/bridge-macros/src/lib.rs +42 -0
- package/lib/native.d.ts +13 -6
- package/package.json +6 -5
- 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/.cargo/config.toml +9 -3
- package/sdk-core/.github/workflows/per-pr.yml +42 -5
- package/sdk-core/AGENTS.md +17 -19
- package/sdk-core/Cargo.toml +6 -7
- package/sdk-core/README.md +12 -15
- package/sdk-core/arch_docs/diagrams/deps.svg +102 -0
- package/sdk-core/{client → crates/client}/Cargo.toml +7 -9
- package/sdk-core/{client → crates/client}/src/lib.rs +110 -159
- package/sdk-core/{client → crates/client}/src/metrics.rs +1 -1
- package/sdk-core/{client → crates/client}/src/raw.rs +73 -44
- package/sdk-core/crates/client/src/request_extensions.rs +40 -0
- package/sdk-core/{client → crates/client}/src/retry.rs +24 -17
- package/sdk-core/crates/client/src/worker/mod.rs +1468 -0
- package/sdk-core/{client → crates/client}/src/workflow_handle/mod.rs +4 -4
- package/sdk-core/{core-api → crates/common}/Cargo.toml +17 -8
- package/sdk-core/crates/common/protos/api_cloud_upstream/VERSION +1 -0
- package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/account/v1/message.proto +18 -0
- package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/request_response.proto +38 -11
- package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/service.proto +21 -4
- package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/operation/v1/message.proto +6 -6
- package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/sink/v1/message.proto +22 -0
- package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/create-release.yml +5 -0
- package/sdk-core/{core-api → crates/common}/src/envconfig.rs +2 -2
- package/sdk-core/{core-api → crates/common}/src/errors.rs +8 -1
- package/sdk-core/{fsm/rustfsm_trait/src/lib.rs → crates/common/src/fsm_trait.rs} +1 -27
- package/sdk-core/{core-api → crates/common}/src/lib.rs +24 -9
- package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/canned_histories.rs +1 -1
- package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/history_builder.rs +1 -1
- package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/history_info.rs +2 -2
- package/sdk-core/{sdk-core-protos/src/lib.rs → crates/common/src/protos/mod.rs} +18 -17
- package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/test_utils.rs +1 -1
- package/sdk-core/{core-api → crates/common}/src/telemetry/metrics.rs +447 -50
- package/sdk-core/{core-api → crates/common}/src/telemetry.rs +3 -1
- package/sdk-core/{core-api → crates/common}/src/worker.rs +112 -18
- package/sdk-core/crates/common/tests/worker_task_types_test.rs +129 -0
- package/sdk-core/crates/macros/Cargo.toml +23 -0
- package/sdk-core/{fsm/rustfsm_procmacro → crates/macros}/src/lib.rs +6 -11
- package/sdk-core/{sdk → crates/sdk}/Cargo.toml +10 -10
- package/sdk-core/{sdk → crates/sdk}/src/activity_context.rs +8 -6
- package/sdk-core/{sdk → crates/sdk}/src/interceptors.rs +1 -1
- package/sdk-core/{sdk → crates/sdk}/src/lib.rs +42 -37
- package/sdk-core/{sdk → crates/sdk}/src/workflow_context/options.rs +2 -2
- package/sdk-core/{sdk → crates/sdk}/src/workflow_context.rs +21 -19
- package/sdk-core/{sdk → crates/sdk}/src/workflow_future.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/Cargo.toml +32 -25
- package/sdk-core/{tests → crates/sdk-core/benches}/workflow_replay_bench.rs +10 -10
- package/sdk-core/crates/sdk-core/machine_coverage/ActivityMachine_Coverage.puml +32 -0
- package/sdk-core/crates/sdk-core/machine_coverage/CancelExternalMachine_Coverage.puml +9 -0
- package/sdk-core/crates/sdk-core/machine_coverage/CancelWorkflowMachine_Coverage.puml +6 -0
- package/sdk-core/crates/sdk-core/machine_coverage/ChildWorkflowMachine_Coverage.puml +27 -0
- package/sdk-core/crates/sdk-core/machine_coverage/CompleteWorkflowMachine_Coverage.puml +6 -0
- package/sdk-core/crates/sdk-core/machine_coverage/ContinueAsNewWorkflowMachine_Coverage.puml +6 -0
- package/sdk-core/crates/sdk-core/machine_coverage/FailWorkflowMachine_Coverage.puml +6 -0
- package/sdk-core/crates/sdk-core/machine_coverage/LocalActivityMachine_Coverage.puml +23 -0
- package/sdk-core/crates/sdk-core/machine_coverage/ModifyWorkflowPropertiesMachine_Coverage.puml +5 -0
- package/sdk-core/crates/sdk-core/machine_coverage/PatchMachine_Coverage.puml +8 -0
- package/sdk-core/crates/sdk-core/machine_coverage/SignalExternalMachine_Coverage.puml +12 -0
- package/sdk-core/crates/sdk-core/machine_coverage/TimerMachine_Coverage.puml +13 -0
- package/sdk-core/crates/sdk-core/machine_coverage/UpdateMachine_Coverage.puml +19 -0
- package/sdk-core/crates/sdk-core/machine_coverage/UpsertSearchAttributesMachine_Coverage.puml +5 -0
- package/sdk-core/crates/sdk-core/machine_coverage/WorkflowTaskMachine_Coverage.puml +11 -0
- package/sdk-core/{core → crates/sdk-core}/src/abstractions.rs +62 -6
- package/sdk-core/crates/sdk-core/src/antithesis.rs +60 -0
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/activity_tasks.rs +36 -31
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/mod.rs +12 -9
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/queries.rs +24 -21
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/replay_flag.rs +10 -8
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/updates.rs +17 -15
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/workers.rs +242 -17
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/workflow_cancels.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/workflow_tasks.rs +126 -39
- package/sdk-core/{core → crates/sdk-core}/src/debug_client.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/src/ephemeral_server/mod.rs +3 -3
- package/sdk-core/crates/sdk-core/src/histfetch.rs +33 -0
- package/sdk-core/{core → crates/sdk-core}/src/internal_flags.rs +4 -3
- package/sdk-core/{core → crates/sdk-core}/src/lib.rs +85 -43
- package/sdk-core/{core → crates/sdk-core}/src/pollers/mod.rs +8 -6
- package/sdk-core/{core → crates/sdk-core}/src/pollers/poll_buffer.rs +51 -16
- package/sdk-core/{core → crates/sdk-core}/src/protosext/mod.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/src/protosext/protocol_messages.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/src/replay/mod.rs +14 -11
- package/sdk-core/{core → crates/sdk-core}/src/retry_logic.rs +19 -1
- package/sdk-core/{core → crates/sdk-core}/src/telemetry/log_export.rs +2 -2
- package/sdk-core/{core → crates/sdk-core}/src/telemetry/metrics.rs +80 -34
- package/sdk-core/{core → crates/sdk-core}/src/telemetry/mod.rs +4 -4
- package/sdk-core/{core → crates/sdk-core}/src/telemetry/otel.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/src/telemetry/prometheus_meter.rs +13 -13
- package/sdk-core/{core → crates/sdk-core}/src/telemetry/prometheus_server.rs +2 -2
- package/sdk-core/{core → crates/sdk-core}/src/test_help/integ_helpers.rs +127 -40
- package/sdk-core/{core → crates/sdk-core}/src/test_help/unit_helpers.rs +13 -11
- package/sdk-core/{core → crates/sdk-core}/src/worker/activities/activity_heartbeat_manager.rs +2 -2
- package/sdk-core/{core → crates/sdk-core}/src/worker/activities/local_activities.rs +14 -12
- package/sdk-core/{core → crates/sdk-core}/src/worker/activities.rs +21 -12
- package/sdk-core/{core → crates/sdk-core}/src/worker/client/mocks.rs +25 -12
- package/sdk-core/{core → crates/sdk-core}/src/worker/client.rs +164 -71
- package/sdk-core/crates/sdk-core/src/worker/heartbeat.rs +246 -0
- package/sdk-core/crates/sdk-core/src/worker/mod.rs +1462 -0
- package/sdk-core/{core → crates/sdk-core}/src/worker/nexus.rs +15 -14
- package/sdk-core/{core → crates/sdk-core}/src/worker/slot_provider.rs +12 -13
- package/sdk-core/{core → crates/sdk-core}/src/worker/tuner/fixed_size.rs +5 -1
- package/sdk-core/{core → crates/sdk-core}/src/worker/tuner/resource_based.rs +453 -57
- package/sdk-core/{core → crates/sdk-core}/src/worker/tuner.rs +21 -4
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/driven_workflow.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/history_update.rs +2 -2
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/activity_state_machine.rs +147 -37
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/cancel_external_state_machine.rs +8 -9
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/cancel_nexus_op_state_machine.rs +14 -12
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/cancel_workflow_state_machine.rs +6 -7
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/child_workflow_state_machine.rs +31 -37
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/complete_workflow_state_machine.rs +13 -8
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/continue_as_new_workflow_state_machine.rs +6 -7
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/fail_workflow_state_machine.rs +6 -7
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/local_activity_state_machine.rs +33 -30
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/mod.rs +22 -17
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/modify_workflow_properties_state_machine.rs +4 -3
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/nexus_operation_state_machine.rs +20 -22
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/patch_state_machine.rs +12 -11
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/signal_external_state_machine.rs +9 -12
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/timer_state_machine.rs +26 -13
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/transition_coverage.rs +1 -2
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/update_state_machine.rs +19 -13
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/upsert_search_attributes_state_machine.rs +20 -18
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/workflow_machines/local_acts.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/workflow_machines.rs +61 -70
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/workflow_task_state_machine.rs +13 -15
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/managed_run.rs +55 -37
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/mod.rs +166 -60
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/run_cache.rs +10 -7
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/wft_extraction.rs +4 -2
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/wft_poller.rs +15 -4
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/workflow_stream.rs +30 -16
- package/sdk-core/{tests → crates/sdk-core/tests}/c_bridge_smoke_test.c +1 -1
- package/sdk-core/{tests → crates/sdk-core/tests}/cloud_tests.rs +1 -1
- package/sdk-core/crates/sdk-core/tests/common/fake_grpc_server.rs +106 -0
- package/sdk-core/{tests → crates/sdk-core/tests}/common/http_proxy.rs +1 -1
- package/sdk-core/{tests → crates/sdk-core/tests}/common/mod.rs +93 -74
- package/sdk-core/{tests → crates/sdk-core/tests}/common/workflows.rs +4 -3
- package/sdk-core/crates/sdk-core/tests/fsm_procmacro.rs +6 -0
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/dupe_transitions_fail.rs +1 -3
- package/sdk-core/crates/sdk-core/tests/fsm_trybuild/dupe_transitions_fail.stderr +12 -0
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/dynamic_dest_pass.rs +2 -4
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/forgot_name_fail.rs +1 -3
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/forgot_name_fail.stderr +4 -4
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/handler_arg_pass.rs +2 -4
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/handler_pass.rs +2 -4
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/medium_complex_pass.rs +2 -4
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/no_handle_conversions_require_into_fail.rs +2 -4
- package/sdk-core/crates/sdk-core/tests/fsm_trybuild/no_handle_conversions_require_into_fail.stderr +15 -0
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/simple_pass.rs +2 -4
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/struct_event_variant_fail.rs +1 -3
- package/sdk-core/crates/sdk-core/tests/fsm_trybuild/struct_event_variant_fail.stderr +5 -0
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/tuple_more_item_event_variant_fail.rs +1 -3
- package/sdk-core/crates/sdk-core/tests/fsm_trybuild/tuple_more_item_event_variant_fail.stderr +5 -0
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/tuple_zero_item_event_variant_fail.rs +1 -3
- package/sdk-core/crates/sdk-core/tests/fsm_trybuild/tuple_zero_item_event_variant_fail.stderr +5 -0
- package/sdk-core/{tests → crates/sdk-core/tests}/global_metric_tests.rs +14 -15
- package/sdk-core/{tests → crates/sdk-core/tests/heavy_tests}/fuzzy_workflow.rs +3 -3
- package/sdk-core/{tests → crates/sdk-core/tests}/heavy_tests.rs +19 -12
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/activity_functions.rs +1 -1
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/client_tests.rs +16 -111
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/ephemeral_server_tests.rs +5 -6
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/heartbeat_tests.rs +23 -19
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/metrics_tests.rs +134 -60
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/pagination_tests.rs +4 -4
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/polling_tests.rs +37 -36
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/queries_tests.rs +12 -10
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/update_tests.rs +41 -29
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/visibility_tests.rs +24 -19
- package/sdk-core/crates/sdk-core/tests/integ_tests/worker_heartbeat_tests.rs +1061 -0
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/worker_tests.rs +113 -51
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/worker_versioning_tests.rs +19 -17
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/activities.rs +35 -30
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/appdata_propagation.rs +3 -3
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/cancel_external.rs +14 -9
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/cancel_wf.rs +13 -8
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/child_workflows.rs +48 -35
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/continue_as_new.rs +14 -9
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/determinism.rs +24 -15
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/eager.rs +9 -4
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/local_activities.rs +47 -47
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/modify_wf_properties.rs +16 -11
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/nexus.rs +51 -23
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/patches.rs +22 -10
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/replay.rs +19 -17
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/resets.rs +14 -5
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/signals.rs +24 -15
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/stickyness.rs +8 -6
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/timers.rs +28 -18
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/upsert_search_attrs.rs +18 -13
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests.rs +46 -41
- package/sdk-core/{tests → crates/sdk-core/tests}/main.rs +15 -9
- package/sdk-core/{tests → crates/sdk-core/tests}/manual_tests.rs +20 -14
- package/sdk-core/{tests → crates/sdk-core/tests}/runner.rs +2 -2
- package/sdk-core/{tests → crates/sdk-core/tests}/shared_tests/mod.rs +10 -5
- package/sdk-core/{tests → crates/sdk-core/tests}/shared_tests/priority.rs +5 -5
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/Cargo.toml +13 -10
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/include/temporal-sdk-core-c-bridge.h +32 -23
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/client.rs +55 -32
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/envconfig.rs +1 -1
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/lib.rs +1 -1
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/metric.rs +1 -1
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/runtime.rs +24 -9
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/testing.rs +1 -1
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/tests/context.rs +11 -10
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/tests/mod.rs +7 -7
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/tests/utils.rs +3 -4
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/worker.rs +111 -58
- package/sdk-core/docker-cgroup-tests.sh +24 -0
- package/sdk-core/{docker → etc/docker}/docker-compose-ci.yaml +9 -9
- package/sdk-core/{docker → etc/docker}/docker-compose-telem.yaml +11 -11
- package/sdk-core/{docker → etc/docker}/docker-compose.yaml +8 -8
- package/sdk-core/{integ-with-otel.sh → etc/integ-with-otel.sh} +1 -1
- package/sdk-core/etc/regen-depgraph.sh +2 -2
- package/src/client.rs +24 -33
- package/src/helpers/try_from_js.rs +1 -1
- package/src/logs.rs +1 -1
- package/src/metrics.rs +3 -3
- package/src/runtime.rs +42 -28
- package/src/testing.rs +3 -3
- package/src/worker.rs +70 -36
- package/ts/native.ts +13 -6
- package/LICENSE.md +0 -23
- package/sdk-core/client/src/worker_registry/mod.rs +0 -282
- package/sdk-core/core/src/worker/heartbeat.rs +0 -230
- package/sdk-core/core/src/worker/mod.rs +0 -990
- package/sdk-core/etc/deps.svg +0 -162
- package/sdk-core/fsm/Cargo.toml +0 -21
- package/sdk-core/fsm/README.md +0 -3
- package/sdk-core/fsm/rustfsm_procmacro/Cargo.toml +0 -27
- package/sdk-core/fsm/rustfsm_procmacro/LICENSE.txt +0 -21
- package/sdk-core/fsm/rustfsm_procmacro/tests/progress.rs +0 -8
- package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/dupe_transitions_fail.stderr +0 -12
- package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/no_handle_conversions_require_into_fail.stderr +0 -15
- package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/struct_event_variant_fail.stderr +0 -5
- package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/tuple_more_item_event_variant_fail.stderr +0 -5
- package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/tuple_zero_item_event_variant_fail.stderr +0 -5
- package/sdk-core/fsm/rustfsm_trait/Cargo.toml +0 -14
- package/sdk-core/fsm/src/lib.rs +0 -2
- package/sdk-core/sdk-core-protos/Cargo.toml +0 -37
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/VERSION +0 -1
- /package/sdk-core/{client → crates/client}/src/callback_based.rs +0 -0
- /package/sdk-core/{client → crates/client}/src/proxy.rs +0 -0
- /package/sdk-core/{client → crates/client}/src/replaceable.rs +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/build.rs +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/.github/workflows/build.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/.github/workflows/push-to-buf.yml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/CODEOWNERS +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/LICENSE +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/Makefile +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/README.md +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/buf.gen.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/buf.lock +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/buf.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/connectivityrule/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/identity/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/namespace/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/nexus/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/region/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/resource/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/usage/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/CODEOWNERS +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/ci.yml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/publish-docs.yml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/push-to-buf.yml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/trigger-api-go-delete-release.yml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/trigger-api-go-publish-release.yml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/trigger-api-go-update.yml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/LICENSE +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/Makefile +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/README.md +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/api-linter.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/buf.gen.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/buf.lock +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/buf.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/api/annotations.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/api/http.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/any.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/descriptor.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/duration.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/empty.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/struct.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/timestamp.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/wrappers.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/openapi/openapiv2.json +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/openapi/openapiv3.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/openapi/payload_description.txt +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/activity/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/batch/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/command/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/common/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/deployment/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/batch_operation.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/command_type.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/common.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/deployment.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/event_type.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/failed_cause.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/namespace.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/nexus.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/query.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/reset.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/schedule.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/task_queue.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/update.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/workflow.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/errordetails/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/export/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/failure/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/filter/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/history/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/namespace/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/nexus/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/operatorservice/v1/request_response.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/operatorservice/v1/service.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/protocol/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/query/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/replication/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/rules/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/schedule/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/sdk/v1/enhanced_stack_trace.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/sdk/v1/task_complete_metadata.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/sdk/v1/user_metadata.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/sdk/v1/worker_config.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/sdk/v1/workflow_metadata.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/taskqueue/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/update/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/version/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/worker/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/workflow/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/google/rpc/status.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/grpc/health/v1/health.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/activity_result/activity_result.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/activity_task/activity_task.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/child_workflow/child_workflow.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/common/common.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/core_interface.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/external_data/external_data.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/nexus/nexus.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/workflow_commands/workflow_commands.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/workflow_completion/workflow_completion.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/testsrv_upstream/Makefile +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/testsrv_upstream/api-linter.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/testsrv_upstream/buf.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/testsrv_upstream/temporal/api/testservice/v1/request_response.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/testsrv_upstream/temporal/api/testservice/v1/service.proto +0 -0
- /package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/constants.rs +0 -0
- /package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/task_token.rs +0 -0
- /package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/utilities.rs +0 -0
- /package/sdk-core/{fsm → crates/macros}/LICENSE.txt +0 -0
- /package/sdk-core/{sdk → crates/sdk}/src/app_data.rs +0 -0
- /package/sdk-core/{core → crates/sdk-core}/src/abstractions/take_cell.rs +0 -0
- /package/sdk-core/{core → crates/sdk-core}/src/test_help/mod.rs +0 -0
- /package/sdk-core/{core → crates/sdk-core}/src/worker/slot_supplier.rs +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/ends_empty_wft_complete.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/evict_while_la_running_no_interference-16_history.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/evict_while_la_running_no_interference-23_history.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/evict_while_la_running_no_interference-85_history.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/fail_wf_task.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/long_local_activity_with_update-0_history.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/long_local_activity_with_update-1_history.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/long_local_activity_with_update-2_history.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/long_local_activity_with_update-3_history.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/old_change_marker_format.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/timer_workflow_history.bin +0 -0
- /package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/priority.rs +0 -0
- /package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/build.rs +0 -0
- /package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/random.rs +0 -0
- /package/sdk-core/{cargo-tokio-console.sh → etc/cargo-tokio-console.sh} +0 -0
|
@@ -14,8 +14,9 @@ mod metrics;
|
|
|
14
14
|
pub mod proxy;
|
|
15
15
|
mod raw;
|
|
16
16
|
mod replaceable;
|
|
17
|
+
pub mod request_extensions;
|
|
17
18
|
mod retry;
|
|
18
|
-
mod
|
|
19
|
+
pub mod worker;
|
|
19
20
|
mod workflow_handle;
|
|
20
21
|
|
|
21
22
|
pub use crate::{
|
|
@@ -25,24 +26,17 @@ pub use crate::{
|
|
|
25
26
|
pub use metrics::{LONG_REQUEST_LATENCY_HISTOGRAM_NAME, REQUEST_LATENCY_HISTOGRAM_NAME};
|
|
26
27
|
pub use raw::{CloudService, HealthService, OperatorService, TestService, WorkflowService};
|
|
27
28
|
pub use replaceable::SharedReplaceableClient;
|
|
28
|
-
pub use temporal_sdk_core_protos::temporal::api::{
|
|
29
|
-
enums::v1::ArchivalState,
|
|
30
|
-
filter::v1::{StartTimeFilter, StatusFilter, WorkflowExecutionFilter, WorkflowTypeFilter},
|
|
31
|
-
workflowservice::v1::{
|
|
32
|
-
list_closed_workflow_executions_request::Filters as ListClosedFilters,
|
|
33
|
-
list_open_workflow_executions_request::Filters as ListOpenFilters,
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
29
|
pub use tonic;
|
|
37
|
-
pub use worker_registry::{Slot, SlotManager, SlotProvider, WorkerKey};
|
|
38
30
|
pub use workflow_handle::{
|
|
39
|
-
|
|
31
|
+
GetWorkflowResultOptions, WorkflowExecutionInfo, WorkflowExecutionResult, WorkflowHandle,
|
|
40
32
|
};
|
|
41
33
|
|
|
42
34
|
use crate::{
|
|
43
35
|
metrics::{ChannelOrGrpcOverride, GrpcMetricSvc, MetricsContext},
|
|
44
36
|
raw::AttachMetricLabels,
|
|
37
|
+
request_extensions::RequestExt,
|
|
45
38
|
sealed::WfHandleClient,
|
|
39
|
+
worker::ClientWorkerSet,
|
|
46
40
|
workflow_handle::UntypedWorkflowHandle,
|
|
47
41
|
};
|
|
48
42
|
use backoff::{ExponentialBackoff, SystemClock, exponential};
|
|
@@ -56,24 +50,31 @@ use std::{
|
|
|
56
50
|
sync::{Arc, OnceLock},
|
|
57
51
|
time::{Duration, Instant},
|
|
58
52
|
};
|
|
59
|
-
use
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
53
|
+
use temporalio_common::{
|
|
54
|
+
protos::{
|
|
55
|
+
TaskToken,
|
|
56
|
+
coresdk::IntoPayloadsExt,
|
|
57
|
+
grpc::health::v1::health_client::HealthClient,
|
|
58
|
+
temporal::api::{
|
|
59
|
+
cloud::cloudservice::v1::cloud_service_client::CloudServiceClient,
|
|
60
|
+
common::{
|
|
61
|
+
self,
|
|
62
|
+
v1::{Header, Payload, Payloads, RetryPolicy, WorkflowExecution, WorkflowType},
|
|
63
|
+
},
|
|
64
|
+
enums::v1::{
|
|
65
|
+
ArchivalState, TaskQueueKind, WorkflowIdConflictPolicy, WorkflowIdReusePolicy,
|
|
66
|
+
},
|
|
67
|
+
filter::v1::StartTimeFilter,
|
|
68
|
+
operatorservice::v1::operator_service_client::OperatorServiceClient,
|
|
69
|
+
query::v1::WorkflowQuery,
|
|
70
|
+
replication::v1::ClusterReplicationConfig,
|
|
71
|
+
taskqueue::v1::TaskQueue,
|
|
72
|
+
testservice::v1::test_service_client::TestServiceClient,
|
|
73
|
+
update,
|
|
74
|
+
workflowservice::v1::{workflow_service_client::WorkflowServiceClient, *},
|
|
75
|
+
},
|
|
76
76
|
},
|
|
77
|
+
telemetry::metrics::TemporalMeter,
|
|
77
78
|
};
|
|
78
79
|
use tonic::{
|
|
79
80
|
Code, IntoRequest,
|
|
@@ -106,72 +107,66 @@ const OTHER_CALL_TIMEOUT: Duration = Duration::from_secs(30);
|
|
|
106
107
|
|
|
107
108
|
type Result<T, E = tonic::Status> = std::result::Result<T, E>;
|
|
108
109
|
|
|
109
|
-
/// Options for the connection to the temporal server. Construct with [
|
|
110
|
-
#[derive(Clone, Debug,
|
|
110
|
+
/// Options for the connection to the temporal server. Construct with [ClientOptions::builder]
|
|
111
|
+
#[derive(Clone, Debug, bon::Builder)]
|
|
111
112
|
#[non_exhaustive]
|
|
113
|
+
#[builder(on(String, into), state_mod(vis = "pub"))]
|
|
112
114
|
pub struct ClientOptions {
|
|
113
115
|
/// The URL of the Temporal server to connect to
|
|
114
|
-
#[builder(
|
|
116
|
+
#[builder(into)]
|
|
115
117
|
pub target_url: Url,
|
|
116
118
|
|
|
117
119
|
/// The name of the SDK being implemented on top of core. Is set as `client-name` header in
|
|
118
120
|
/// all RPC calls
|
|
119
|
-
#[builder(setter(into))]
|
|
120
121
|
pub client_name: String,
|
|
121
122
|
|
|
122
123
|
/// The version of the SDK being implemented on top of core. Is set as `client-version` header
|
|
123
124
|
/// in all RPC calls. The server decides if the client is supported based on this.
|
|
124
|
-
#[builder(setter(into))]
|
|
125
125
|
pub client_version: String,
|
|
126
126
|
|
|
127
127
|
/// A human-readable string that can identify this process. Defaults to empty string.
|
|
128
|
-
#[builder(
|
|
128
|
+
#[builder(default)]
|
|
129
129
|
pub identity: String,
|
|
130
130
|
|
|
131
|
-
/// If specified, use TLS as configured by the [
|
|
131
|
+
/// If specified, use TLS as configured by the [TlsOptions] struct. If this is set core will
|
|
132
132
|
/// attempt to use TLS when connecting to the Temporal server. Lang SDK is expected to pass any
|
|
133
133
|
/// certs or keys as bytes, loading them from disk itself if needed.
|
|
134
|
-
|
|
135
|
-
pub tls_cfg: Option<TlsConfig>,
|
|
134
|
+
pub tls_options: Option<TlsOptions>,
|
|
136
135
|
|
|
137
|
-
/// Retry configuration for the server client. Default is [
|
|
136
|
+
/// Retry configuration for the server client. Default is [RetryOptions::default]
|
|
138
137
|
#[builder(default)]
|
|
139
|
-
pub
|
|
138
|
+
pub retry_options: RetryOptions,
|
|
140
139
|
|
|
141
140
|
/// If set, override the origin used when connecting. May be useful in rare situations where tls
|
|
142
141
|
/// verification needs to use a different name from what should be set as the `:authority`
|
|
143
|
-
/// header. If [
|
|
142
|
+
/// header. If [TlsOptions::domain] is set, and this is not, this will be set to
|
|
144
143
|
/// `https://<domain>`, effectively making the `:authority` header consistent with the domain
|
|
145
144
|
/// override.
|
|
146
|
-
#[builder(default)]
|
|
147
145
|
pub override_origin: Option<Uri>,
|
|
148
146
|
|
|
149
|
-
/// If set
|
|
150
|
-
|
|
151
|
-
|
|
147
|
+
/// If set, HTTP2 gRPC keep alive will be enabled.
|
|
148
|
+
/// To enable with default settings, use `.keep_alive(ClientKeepAliveConfig::default())`.
|
|
149
|
+
#[builder(required, default = Some(ClientKeepAliveOptions::default()))]
|
|
150
|
+
pub keep_alive: Option<ClientKeepAliveOptions>,
|
|
152
151
|
|
|
153
152
|
/// HTTP headers to include on every RPC call.
|
|
154
153
|
///
|
|
155
154
|
/// These must be valid gRPC metadata keys, and must not be binary metadata keys (ending in
|
|
156
155
|
/// `-bin). To set binary headers, use [ClientOptions::binary_headers]. Invalid header keys or
|
|
157
156
|
/// values will cause an error to be returned when connecting.
|
|
158
|
-
#[builder(default)]
|
|
159
157
|
pub headers: Option<HashMap<String, String>>,
|
|
160
158
|
|
|
161
159
|
/// HTTP headers to include on every RPC call as binary gRPC metadata (encoded as base64).
|
|
162
160
|
///
|
|
163
161
|
/// These must be valid binary gRPC metadata keys (and end with a `-bin` suffix). Invalid
|
|
164
162
|
/// header keys will cause an error to be returned when connecting.
|
|
165
|
-
#[builder(default)]
|
|
166
163
|
pub binary_headers: Option<HashMap<String, Vec<u8>>>,
|
|
167
164
|
|
|
168
165
|
/// API key which is set as the "Authorization" header with "Bearer " prepended. This will only
|
|
169
166
|
/// be applied if the headers don't already have an "Authorization" header.
|
|
170
|
-
#[builder(default)]
|
|
171
167
|
pub api_key: Option<String>,
|
|
172
168
|
|
|
173
169
|
/// HTTP CONNECT proxy to use for this client.
|
|
174
|
-
#[builder(default)]
|
|
175
170
|
pub http_connect_proxy: Option<HttpConnectProxyOptions>,
|
|
176
171
|
|
|
177
172
|
/// If set true, error code labels will not be included on request failure metrics.
|
|
@@ -185,7 +180,7 @@ pub struct ClientOptions {
|
|
|
185
180
|
|
|
186
181
|
/// Configuration options for TLS
|
|
187
182
|
#[derive(Clone, Debug, Default)]
|
|
188
|
-
pub struct
|
|
183
|
+
pub struct TlsOptions {
|
|
189
184
|
/// Bytes representing the root CA certificate used by the server. If not set, and the server's
|
|
190
185
|
/// cert is issued by someone the operating system trusts, verification will still work (ex:
|
|
191
186
|
/// Cloud offering).
|
|
@@ -194,12 +189,12 @@ pub struct TlsConfig {
|
|
|
194
189
|
/// the domain name will be extracted from the URL used to connect.
|
|
195
190
|
pub domain: Option<String>,
|
|
196
191
|
/// TLS info for the client. If specified, core will attempt to use mTLS.
|
|
197
|
-
pub
|
|
192
|
+
pub client_tls_options: Option<ClientTlsOptions>,
|
|
198
193
|
}
|
|
199
194
|
|
|
200
195
|
/// If using mTLS, both the client cert and private key must be specified, this contains them.
|
|
201
196
|
#[derive(Clone)]
|
|
202
|
-
pub struct
|
|
197
|
+
pub struct ClientTlsOptions {
|
|
203
198
|
/// The certificate for this client, encoded as PEM
|
|
204
199
|
pub client_cert: Vec<u8>,
|
|
205
200
|
/// The private key for this client, encoded as PEM
|
|
@@ -208,14 +203,14 @@ pub struct ClientTlsConfig {
|
|
|
208
203
|
|
|
209
204
|
/// Client keep alive configuration.
|
|
210
205
|
#[derive(Clone, Debug)]
|
|
211
|
-
pub struct
|
|
206
|
+
pub struct ClientKeepAliveOptions {
|
|
212
207
|
/// Interval to send HTTP2 keep alive pings.
|
|
213
208
|
pub interval: Duration,
|
|
214
209
|
/// Timeout that the keep alive must be responded to within or the connection will be closed.
|
|
215
210
|
pub timeout: Duration,
|
|
216
211
|
}
|
|
217
212
|
|
|
218
|
-
impl Default for
|
|
213
|
+
impl Default for ClientKeepAliveOptions {
|
|
219
214
|
fn default() -> Self {
|
|
220
215
|
Self {
|
|
221
216
|
interval: Duration::from_secs(30),
|
|
@@ -226,7 +221,7 @@ impl Default for ClientKeepAliveConfig {
|
|
|
226
221
|
|
|
227
222
|
/// Configuration for retrying requests to the server
|
|
228
223
|
#[derive(Clone, Debug, PartialEq)]
|
|
229
|
-
pub struct
|
|
224
|
+
pub struct RetryOptions {
|
|
230
225
|
/// initial wait time before the first retry.
|
|
231
226
|
pub initial_interval: Duration,
|
|
232
227
|
/// randomization jitter that is used as a multiplier for the current retry interval
|
|
@@ -243,7 +238,7 @@ pub struct RetryConfig {
|
|
|
243
238
|
pub max_retries: usize,
|
|
244
239
|
}
|
|
245
240
|
|
|
246
|
-
impl Default for
|
|
241
|
+
impl Default for RetryOptions {
|
|
247
242
|
fn default() -> Self {
|
|
248
243
|
Self {
|
|
249
244
|
initial_interval: Duration::from_millis(100), // 100 ms wait by default.
|
|
@@ -256,7 +251,7 @@ impl Default for RetryConfig {
|
|
|
256
251
|
}
|
|
257
252
|
}
|
|
258
253
|
|
|
259
|
-
impl
|
|
254
|
+
impl RetryOptions {
|
|
260
255
|
pub(crate) const fn task_poll_retry_policy() -> Self {
|
|
261
256
|
Self {
|
|
262
257
|
initial_interval: Duration::from_millis(200),
|
|
@@ -305,30 +300,16 @@ impl RetryConfig {
|
|
|
305
300
|
}
|
|
306
301
|
}
|
|
307
302
|
|
|
308
|
-
impl From<
|
|
309
|
-
fn from(c:
|
|
303
|
+
impl From<RetryOptions> for ExponentialBackoff {
|
|
304
|
+
fn from(c: RetryOptions) -> Self {
|
|
310
305
|
c.into_exp_backoff(SystemClock::default())
|
|
311
306
|
}
|
|
312
307
|
}
|
|
313
308
|
|
|
314
|
-
|
|
315
|
-
/// [CallType::TaskLongPoll]
|
|
316
|
-
#[derive(Copy, Clone, Debug)]
|
|
317
|
-
pub struct IsWorkerTaskLongPoll;
|
|
318
|
-
|
|
319
|
-
/// A request extension that, when set, and a call is being processed by a [RetryClient], allows the
|
|
320
|
-
/// caller to request certain matching errors to short-circuit-return immediately and not follow
|
|
321
|
-
/// normal retry logic.
|
|
322
|
-
#[derive(Copy, Clone, Debug)]
|
|
323
|
-
pub struct NoRetryOnMatching {
|
|
324
|
-
/// Return true if the passed-in gRPC error should be immediately returned to the caller
|
|
325
|
-
pub predicate: fn(&tonic::Status) -> bool,
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
impl Debug for ClientTlsConfig {
|
|
309
|
+
impl Debug for ClientTlsOptions {
|
|
329
310
|
// Intentionally omit details here since they could leak a key if ever printed
|
|
330
311
|
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
|
331
|
-
write!(f, "
|
|
312
|
+
write!(f, "ClientTlsOptions(..)")
|
|
332
313
|
}
|
|
333
314
|
}
|
|
334
315
|
|
|
@@ -390,7 +371,7 @@ pub struct ConfiguredClient<C> {
|
|
|
390
371
|
headers: Arc<RwLock<ClientHeaders>>,
|
|
391
372
|
/// Capabilities as read from the `get_system_info` RPC call made on client connection
|
|
392
373
|
capabilities: Option<get_system_info_response::Capabilities>,
|
|
393
|
-
workers: Arc<
|
|
374
|
+
workers: Arc<ClientWorkerSet>,
|
|
394
375
|
}
|
|
395
376
|
|
|
396
377
|
impl<C> ConfiguredClient<C> {
|
|
@@ -440,9 +421,14 @@ impl<C> ConfiguredClient<C> {
|
|
|
440
421
|
}
|
|
441
422
|
|
|
442
423
|
/// Returns a cloned reference to a registry with workers using this client instance
|
|
443
|
-
pub fn workers(&self) -> Arc<
|
|
424
|
+
pub fn workers(&self) -> Arc<ClientWorkerSet> {
|
|
444
425
|
self.workers.clone()
|
|
445
426
|
}
|
|
427
|
+
|
|
428
|
+
/// Returns the worker grouping key, this should be unique across each client
|
|
429
|
+
pub fn worker_grouping_key(&self) -> Uuid {
|
|
430
|
+
self.workers.worker_grouping_key()
|
|
431
|
+
}
|
|
446
432
|
}
|
|
447
433
|
|
|
448
434
|
#[derive(Debug)]
|
|
@@ -502,7 +488,7 @@ impl ClientOptions {
|
|
|
502
488
|
) -> Result<RetryClient<Client>, ClientInitError> {
|
|
503
489
|
let client = self.connect_no_namespace(metrics_meter).await?.into_inner();
|
|
504
490
|
let client = Client::new(client, namespace.into());
|
|
505
|
-
let retry_client = RetryClient::new(client, self.
|
|
491
|
+
let retry_client = RetryClient::new(client, self.retry_options.clone());
|
|
506
492
|
Ok(retry_client)
|
|
507
493
|
}
|
|
508
494
|
|
|
@@ -584,7 +570,7 @@ impl ClientOptions {
|
|
|
584
570
|
client: TemporalServiceClient::new(svc),
|
|
585
571
|
options: Arc::new(self.clone()),
|
|
586
572
|
capabilities: None,
|
|
587
|
-
workers: Arc::new(
|
|
573
|
+
workers: Arc::new(ClientWorkerSet::new()),
|
|
588
574
|
};
|
|
589
575
|
if !self.skip_get_system_info {
|
|
590
576
|
match client
|
|
@@ -600,13 +586,13 @@ impl ClientOptions {
|
|
|
600
586
|
},
|
|
601
587
|
};
|
|
602
588
|
}
|
|
603
|
-
Ok(RetryClient::new(client, self.
|
|
589
|
+
Ok(RetryClient::new(client, self.retry_options.clone()))
|
|
604
590
|
}
|
|
605
591
|
|
|
606
592
|
/// If TLS is configured, set the appropriate options on the provided channel and return it.
|
|
607
593
|
/// Passes it through if TLS options not set.
|
|
608
594
|
async fn add_tls_to_channel(&self, mut channel: Endpoint) -> Result<Endpoint, ClientInitError> {
|
|
609
|
-
if let Some(tls_cfg) = &self.
|
|
595
|
+
if let Some(tls_cfg) = &self.tls_options {
|
|
610
596
|
let mut tls = tonic::transport::ClientTlsConfig::new();
|
|
611
597
|
|
|
612
598
|
if let Some(root_cert) = &tls_cfg.server_root_ca_cert {
|
|
@@ -627,7 +613,7 @@ impl ClientOptions {
|
|
|
627
613
|
channel = channel.origin(uri);
|
|
628
614
|
}
|
|
629
615
|
|
|
630
|
-
if let Some(client_opts) = &tls_cfg.
|
|
616
|
+
if let Some(client_opts) = &tls_cfg.client_tls_options {
|
|
631
617
|
let client_identity =
|
|
632
618
|
Identity::from_pem(&client_opts.client_cert, &client_opts.client_private_key);
|
|
633
619
|
tls = tls.identity(client_identity);
|
|
@@ -866,6 +852,11 @@ impl Client {
|
|
|
866
852
|
pub fn into_inner(self) -> ConfiguredClient<TemporalServiceClient> {
|
|
867
853
|
self.inner
|
|
868
854
|
}
|
|
855
|
+
|
|
856
|
+
/// Returns the client-wide key
|
|
857
|
+
pub fn worker_grouping_key(&self) -> Uuid {
|
|
858
|
+
self.inner.worker_grouping_key()
|
|
859
|
+
}
|
|
869
860
|
}
|
|
870
861
|
|
|
871
862
|
impl NamespacedClient for Client {
|
|
@@ -899,60 +890,51 @@ impl Namespace {
|
|
|
899
890
|
}
|
|
900
891
|
|
|
901
892
|
/// Default workflow execution retention for a Namespace is 3 days
|
|
902
|
-
|
|
903
|
-
Duration::from_secs(60 * 60 * 24 * 3);
|
|
893
|
+
const DEFAULT_WORKFLOW_EXECUTION_RETENTION_PERIOD: Duration = Duration::from_secs(60 * 60 * 24 * 3);
|
|
904
894
|
|
|
905
895
|
/// Helper struct for `register_namespace`.
|
|
906
|
-
#[derive(Clone,
|
|
896
|
+
#[derive(Clone, bon::Builder)]
|
|
897
|
+
#[builder(on(String, into))]
|
|
907
898
|
pub struct RegisterNamespaceOptions {
|
|
908
899
|
/// Name (required)
|
|
909
|
-
#[builder(setter(into))]
|
|
910
900
|
pub namespace: String,
|
|
911
901
|
/// Description (required)
|
|
912
|
-
#[builder(setter(into))]
|
|
913
902
|
pub description: String,
|
|
914
903
|
/// Owner's email
|
|
915
|
-
#[builder(
|
|
904
|
+
#[builder(default)]
|
|
916
905
|
pub owner_email: String,
|
|
917
906
|
/// Workflow execution retention period
|
|
918
|
-
#[builder(default =
|
|
907
|
+
#[builder(default = DEFAULT_WORKFLOW_EXECUTION_RETENTION_PERIOD)]
|
|
919
908
|
pub workflow_execution_retention_period: Duration,
|
|
920
909
|
/// Cluster settings
|
|
921
|
-
#[builder(
|
|
910
|
+
#[builder(default)]
|
|
922
911
|
pub clusters: Vec<ClusterReplicationConfig>,
|
|
923
912
|
/// Active cluster name
|
|
924
|
-
#[builder(
|
|
913
|
+
#[builder(default)]
|
|
925
914
|
pub active_cluster_name: String,
|
|
926
915
|
/// Custom Data
|
|
927
916
|
#[builder(default)]
|
|
928
917
|
pub data: HashMap<String, String>,
|
|
929
918
|
/// Security Token
|
|
930
|
-
#[builder(
|
|
919
|
+
#[builder(default)]
|
|
931
920
|
pub security_token: String,
|
|
932
921
|
/// Global namespace
|
|
933
922
|
#[builder(default)]
|
|
934
923
|
pub is_global_namespace: bool,
|
|
935
924
|
/// History Archival setting
|
|
936
|
-
#[builder(
|
|
925
|
+
#[builder(default = ArchivalState::Unspecified)]
|
|
937
926
|
pub history_archival_state: ArchivalState,
|
|
938
927
|
/// History Archival uri
|
|
939
|
-
#[builder(
|
|
928
|
+
#[builder(default)]
|
|
940
929
|
pub history_archival_uri: String,
|
|
941
930
|
/// Visibility Archival setting
|
|
942
|
-
#[builder(
|
|
931
|
+
#[builder(default = ArchivalState::Unspecified)]
|
|
943
932
|
pub visibility_archival_state: ArchivalState,
|
|
944
933
|
/// Visibility Archival uri
|
|
945
|
-
#[builder(
|
|
934
|
+
#[builder(default)]
|
|
946
935
|
pub visibility_archival_uri: String,
|
|
947
936
|
}
|
|
948
937
|
|
|
949
|
-
impl RegisterNamespaceOptions {
|
|
950
|
-
/// Builder convenience. Less `use` imports
|
|
951
|
-
pub fn builder() -> RegisterNamespaceOptionsBuilder {
|
|
952
|
-
Default::default()
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
|
|
956
938
|
impl From<RegisterNamespaceOptions> for RegisterNamespaceRequest {
|
|
957
939
|
fn from(val: RegisterNamespaceOptions) -> Self {
|
|
958
940
|
RegisterNamespaceRequest {
|
|
@@ -976,55 +958,31 @@ impl From<RegisterNamespaceOptions> for RegisterNamespaceRequest {
|
|
|
976
958
|
}
|
|
977
959
|
}
|
|
978
960
|
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
/// Warning: setting cluster_names could blow away any previously set cluster configs
|
|
982
|
-
pub fn cluster_names(&mut self, clusters: Vec<String>) {
|
|
983
|
-
self.clusters = Some(
|
|
984
|
-
clusters
|
|
985
|
-
.into_iter()
|
|
986
|
-
.map(|s| ClusterReplicationConfig { cluster_name: s })
|
|
987
|
-
.collect(),
|
|
988
|
-
);
|
|
989
|
-
}
|
|
990
|
-
}
|
|
961
|
+
// Note: The cluster_names custom setter from derive_builder is not supported in bon.
|
|
962
|
+
// Users should manually construct the clusters vector if needed.
|
|
991
963
|
|
|
992
964
|
/// Helper struct for `signal_with_start_workflow_execution`.
|
|
993
|
-
#[derive(Clone,
|
|
965
|
+
#[derive(Clone, bon::Builder)]
|
|
966
|
+
#[builder(on(String, into))]
|
|
994
967
|
pub struct SignalWithStartOptions {
|
|
995
968
|
/// Input payload for the workflow run
|
|
996
|
-
#[builder(setter(strip_option), default)]
|
|
997
969
|
pub input: Option<Payloads>,
|
|
998
970
|
/// Task Queue to target (required)
|
|
999
|
-
#[builder(setter(into))]
|
|
1000
971
|
pub task_queue: String,
|
|
1001
972
|
/// Workflow id for the workflow run
|
|
1002
|
-
#[builder(setter(into))]
|
|
1003
973
|
pub workflow_id: String,
|
|
1004
974
|
/// Workflow type for the workflow run
|
|
1005
|
-
#[builder(setter(into))]
|
|
1006
975
|
pub workflow_type: String,
|
|
1007
|
-
#[builder(setter(strip_option), default)]
|
|
1008
976
|
/// Request id for idempotency/deduplication
|
|
1009
977
|
pub request_id: Option<String>,
|
|
1010
978
|
/// The signal name to send (required)
|
|
1011
|
-
#[builder(setter(into))]
|
|
1012
979
|
pub signal_name: String,
|
|
1013
980
|
/// Payloads for the signal
|
|
1014
|
-
#[builder(default)]
|
|
1015
981
|
pub signal_input: Option<Payloads>,
|
|
1016
|
-
#[builder(setter(strip_option), default)]
|
|
1017
982
|
/// Headers for the signal
|
|
1018
983
|
pub signal_header: Option<Header>,
|
|
1019
984
|
}
|
|
1020
985
|
|
|
1021
|
-
impl SignalWithStartOptions {
|
|
1022
|
-
/// Builder convenience. Less `use` imports
|
|
1023
|
-
pub fn builder() -> SignalWithStartOptionsBuilder {
|
|
1024
|
-
Default::default()
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
|
|
1028
986
|
/// This trait provides higher-level friendlier interaction with the server.
|
|
1029
987
|
/// See the [WorkflowService] trait for a lower-level client.
|
|
1030
988
|
#[async_trait::async_trait]
|
|
@@ -1152,7 +1110,7 @@ pub trait WorkflowClientTrait: NamespacedClient {
|
|
|
1152
1110
|
max_page_size: i32,
|
|
1153
1111
|
next_page_token: Vec<u8>,
|
|
1154
1112
|
start_time_filter: Option<StartTimeFilter>,
|
|
1155
|
-
filters: Option<
|
|
1113
|
+
filters: Option<list_open_workflow_executions_request::Filters>,
|
|
1156
1114
|
) -> Result<ListOpenWorkflowExecutionsResponse>;
|
|
1157
1115
|
|
|
1158
1116
|
/// List closed workflow executions Standard Visibility filtering
|
|
@@ -1161,7 +1119,7 @@ pub trait WorkflowClientTrait: NamespacedClient {
|
|
|
1161
1119
|
max_page_size: i32,
|
|
1162
1120
|
next_page_token: Vec<u8>,
|
|
1163
1121
|
start_time_filter: Option<StartTimeFilter>,
|
|
1164
|
-
filters: Option<
|
|
1122
|
+
filters: Option<list_closed_workflow_executions_request::Filters>,
|
|
1165
1123
|
) -> Result<ListClosedWorkflowExecutionsResponse>;
|
|
1166
1124
|
|
|
1167
1125
|
/// List workflow executions with Advanced Visibility filtering
|
|
@@ -1229,7 +1187,7 @@ pub struct WorkflowOptions {
|
|
|
1229
1187
|
pub search_attributes: Option<HashMap<String, Payload>>,
|
|
1230
1188
|
|
|
1231
1189
|
/// Optionally enable Eager Workflow Start, a latency optimization using local workers
|
|
1232
|
-
/// NOTE: Experimental
|
|
1190
|
+
/// NOTE: Experimental
|
|
1233
1191
|
pub enable_eager_workflow_start: bool,
|
|
1234
1192
|
|
|
1235
1193
|
/// Optionally set a retry policy for the workflow
|
|
@@ -1697,7 +1655,7 @@ where
|
|
|
1697
1655
|
maximum_page_size: i32,
|
|
1698
1656
|
next_page_token: Vec<u8>,
|
|
1699
1657
|
start_time_filter: Option<StartTimeFilter>,
|
|
1700
|
-
filters: Option<
|
|
1658
|
+
filters: Option<list_open_workflow_executions_request::Filters>,
|
|
1701
1659
|
) -> Result<ListOpenWorkflowExecutionsResponse> {
|
|
1702
1660
|
Ok(WorkflowService::list_open_workflow_executions(
|
|
1703
1661
|
&mut self.clone(),
|
|
@@ -1719,7 +1677,7 @@ where
|
|
|
1719
1677
|
maximum_page_size: i32,
|
|
1720
1678
|
next_page_token: Vec<u8>,
|
|
1721
1679
|
start_time_filter: Option<StartTimeFilter>,
|
|
1722
|
-
filters: Option<
|
|
1680
|
+
filters: Option<list_closed_workflow_executions_request::Filters>,
|
|
1723
1681
|
) -> Result<ListClosedWorkflowExecutionsResponse> {
|
|
1724
1682
|
Ok(WorkflowService::list_closed_workflow_executions(
|
|
1725
1683
|
&mut self.clone(),
|
|
@@ -1851,18 +1809,6 @@ pub trait WfClientExt: WfHandleClient + Sized + Clone {
|
|
|
1851
1809
|
|
|
1852
1810
|
impl<T> WfClientExt for T where T: WfHandleClient + Clone + Sized {}
|
|
1853
1811
|
|
|
1854
|
-
trait RequestExt {
|
|
1855
|
-
/// Set a timeout for a request if one is not already specified in the metadata
|
|
1856
|
-
fn set_default_timeout(&mut self, duration: Duration);
|
|
1857
|
-
}
|
|
1858
|
-
impl<T> RequestExt for tonic::Request<T> {
|
|
1859
|
-
fn set_default_timeout(&mut self, duration: Duration) {
|
|
1860
|
-
if !self.metadata().contains_key("grpc-timeout") {
|
|
1861
|
-
self.set_timeout(duration)
|
|
1862
|
-
}
|
|
1863
|
-
}
|
|
1864
|
-
}
|
|
1865
|
-
|
|
1866
1812
|
macro_rules! dbg_panic {
|
|
1867
1813
|
($($arg:tt)*) => {
|
|
1868
1814
|
use tracing::error;
|
|
@@ -1879,13 +1825,12 @@ mod tests {
|
|
|
1879
1825
|
|
|
1880
1826
|
#[test]
|
|
1881
1827
|
fn applies_headers() {
|
|
1882
|
-
let opts =
|
|
1828
|
+
let opts = ClientOptions::builder()
|
|
1883
1829
|
.identity("enchicat".to_string())
|
|
1884
1830
|
.target_url(Url::parse("https://smolkitty").unwrap())
|
|
1885
1831
|
.client_name("cute-kitty".to_string())
|
|
1886
1832
|
.client_version("0.1.0".to_string())
|
|
1887
|
-
.build()
|
|
1888
|
-
.unwrap();
|
|
1833
|
+
.build();
|
|
1889
1834
|
|
|
1890
1835
|
// Initial header set
|
|
1891
1836
|
let headers = Arc::new(RwLock::new(ClientHeaders {
|
|
@@ -2014,24 +1959,30 @@ mod tests {
|
|
|
2014
1959
|
|
|
2015
1960
|
#[test]
|
|
2016
1961
|
fn keep_alive_defaults() {
|
|
2017
|
-
let
|
|
2018
|
-
builder
|
|
1962
|
+
let opts = ClientOptions::builder()
|
|
2019
1963
|
.identity("enchicat".to_string())
|
|
2020
1964
|
.target_url(Url::parse("https://smolkitty").unwrap())
|
|
2021
1965
|
.client_name("cute-kitty".to_string())
|
|
2022
|
-
.client_version("0.1.0".to_string())
|
|
2023
|
-
|
|
2024
|
-
let opts = builder.build().unwrap();
|
|
1966
|
+
.client_version("0.1.0".to_string())
|
|
1967
|
+
.build();
|
|
2025
1968
|
assert_eq!(
|
|
2026
1969
|
opts.keep_alive.clone().unwrap().interval,
|
|
2027
|
-
|
|
1970
|
+
ClientKeepAliveOptions::default().interval
|
|
2028
1971
|
);
|
|
2029
1972
|
assert_eq!(
|
|
2030
1973
|
opts.keep_alive.clone().unwrap().timeout,
|
|
2031
|
-
|
|
1974
|
+
ClientKeepAliveOptions::default().timeout
|
|
2032
1975
|
);
|
|
2033
|
-
|
|
2034
|
-
|
|
1976
|
+
|
|
1977
|
+
// Can be explicitly set to None
|
|
1978
|
+
let opts = ClientOptions::builder()
|
|
1979
|
+
.identity("enchicat".to_string())
|
|
1980
|
+
.target_url(Url::parse("https://smolkitty").unwrap())
|
|
1981
|
+
.client_name("cute-kitty".to_string())
|
|
1982
|
+
.client_version("0.1.0".to_string())
|
|
1983
|
+
.keep_alive(None)
|
|
1984
|
+
.build();
|
|
1985
|
+
dbg!(&opts.keep_alive);
|
|
2035
1986
|
assert!(opts.keep_alive.is_none());
|
|
2036
1987
|
}
|
|
2037
1988
|
}
|
|
@@ -9,7 +9,7 @@ use std::{
|
|
|
9
9
|
task::{Context, Poll},
|
|
10
10
|
time::{Duration, Instant},
|
|
11
11
|
};
|
|
12
|
-
use
|
|
12
|
+
use temporalio_common::telemetry::{
|
|
13
13
|
TaskQueueLabelStrategy,
|
|
14
14
|
metrics::{
|
|
15
15
|
CoreMeter, Counter, CounterBase, HistogramDuration, HistogramDurationBase,
|