@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
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
use futures_util::future::{BoxFuture, FutureExt};
|
|
2
|
+
use std::{
|
|
3
|
+
convert::Infallible,
|
|
4
|
+
task::{Context, Poll},
|
|
5
|
+
};
|
|
6
|
+
use tokio::{
|
|
7
|
+
net::TcpListener,
|
|
8
|
+
sync::{mpsc::UnboundedSender, oneshot},
|
|
9
|
+
};
|
|
10
|
+
use tonic::{
|
|
11
|
+
body::Body,
|
|
12
|
+
codegen::{Service, http::Response},
|
|
13
|
+
server::NamedService,
|
|
14
|
+
transport::Server,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
#[derive(Clone)]
|
|
18
|
+
pub(crate) struct GenericService<F> {
|
|
19
|
+
pub header_to_parse: &'static str,
|
|
20
|
+
pub header_tx: UnboundedSender<String>,
|
|
21
|
+
pub response_maker: F,
|
|
22
|
+
}
|
|
23
|
+
impl<F> Service<tonic::codegen::http::Request<Body>> for GenericService<F>
|
|
24
|
+
where
|
|
25
|
+
F: FnMut(tonic::codegen::http::Request<Body>) -> BoxFuture<'static, Response<Body>>,
|
|
26
|
+
{
|
|
27
|
+
type Response = Response<Body>;
|
|
28
|
+
type Error = Infallible;
|
|
29
|
+
type Future = BoxFuture<'static, Result<Self::Response, Self::Error>>;
|
|
30
|
+
|
|
31
|
+
fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
|
32
|
+
Poll::Ready(Ok(()))
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
fn call(&mut self, req: tonic::codegen::http::Request<Body>) -> Self::Future {
|
|
36
|
+
self.header_tx
|
|
37
|
+
.send(
|
|
38
|
+
String::from_utf8_lossy(
|
|
39
|
+
req.headers()
|
|
40
|
+
.get(self.header_to_parse)
|
|
41
|
+
.map(|hv| hv.as_bytes())
|
|
42
|
+
.unwrap_or_default(),
|
|
43
|
+
)
|
|
44
|
+
.to_string(),
|
|
45
|
+
)
|
|
46
|
+
.unwrap();
|
|
47
|
+
let r = (self.response_maker)(req);
|
|
48
|
+
async move { Ok(r.await) }.boxed()
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
impl<F> NamedService for GenericService<F> {
|
|
52
|
+
const NAME: &'static str = "temporal.api.workflowservice.v1.WorkflowService";
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
pub(crate) struct FakeServer {
|
|
56
|
+
pub addr: std::net::SocketAddr,
|
|
57
|
+
shutdown_tx: oneshot::Sender<()>,
|
|
58
|
+
pub header_rx: tokio::sync::mpsc::UnboundedReceiver<String>,
|
|
59
|
+
pub server_handle: tokio::task::JoinHandle<()>,
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
pub(crate) async fn fake_server<F>(response_maker: F) -> FakeServer
|
|
63
|
+
where
|
|
64
|
+
F: FnMut(tonic::codegen::http::Request<Body>) -> BoxFuture<'static, Response<Body>>
|
|
65
|
+
+ Clone
|
|
66
|
+
+ Send
|
|
67
|
+
+ Sync
|
|
68
|
+
+ 'static,
|
|
69
|
+
{
|
|
70
|
+
let (shutdown_tx, shutdown_rx) = oneshot::channel::<()>();
|
|
71
|
+
let (header_tx, header_rx) = tokio::sync::mpsc::unbounded_channel();
|
|
72
|
+
|
|
73
|
+
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
|
|
74
|
+
let addr = listener.local_addr().unwrap();
|
|
75
|
+
|
|
76
|
+
let server_handle = tokio::spawn(async move {
|
|
77
|
+
Server::builder()
|
|
78
|
+
.add_service(GenericService {
|
|
79
|
+
header_to_parse: "grpc-timeout",
|
|
80
|
+
header_tx,
|
|
81
|
+
response_maker,
|
|
82
|
+
})
|
|
83
|
+
.serve_with_incoming_shutdown(
|
|
84
|
+
tokio_stream::wrappers::TcpListenerStream::new(listener),
|
|
85
|
+
async {
|
|
86
|
+
shutdown_rx.await.ok();
|
|
87
|
+
},
|
|
88
|
+
)
|
|
89
|
+
.await
|
|
90
|
+
.unwrap();
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
FakeServer {
|
|
94
|
+
addr,
|
|
95
|
+
shutdown_tx,
|
|
96
|
+
header_rx,
|
|
97
|
+
server_handle,
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
impl FakeServer {
|
|
102
|
+
pub(crate) async fn shutdown(self) {
|
|
103
|
+
self.shutdown_tx.send(()).unwrap();
|
|
104
|
+
self.server_handle.await.unwrap();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//! Common integration testing utilities
|
|
2
2
|
//! These utilities are specific to integration tests and depend on the full temporal-client stack.
|
|
3
3
|
|
|
4
|
+
pub(crate) mod fake_grpc_server;
|
|
4
5
|
pub(crate) mod http_proxy;
|
|
5
6
|
pub(crate) mod workflows;
|
|
6
7
|
|
|
@@ -26,50 +27,52 @@ use std::{
|
|
|
26
27
|
},
|
|
27
28
|
time::{Duration, Instant},
|
|
28
29
|
};
|
|
29
|
-
use
|
|
30
|
-
Client,
|
|
30
|
+
use temporalio_client::{
|
|
31
|
+
Client, ClientTlsOptions, GetWorkflowResultOptions, NamespacedClient, RetryClient, TlsOptions,
|
|
31
32
|
WfClientExt, WorkflowClientTrait, WorkflowExecutionInfo, WorkflowExecutionResult,
|
|
32
33
|
WorkflowHandle, WorkflowOptions,
|
|
33
34
|
};
|
|
34
|
-
use
|
|
35
|
-
IntoActivityFunc, Worker, WorkflowFunction,
|
|
36
|
-
interceptors::{
|
|
37
|
-
FailOnNondeterminismInterceptor, InterceptorWithNext, ReturnWorkflowExitValueInterceptor,
|
|
38
|
-
WorkerInterceptor,
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
use temporal_sdk_core::{
|
|
42
|
-
ClientOptions, ClientOptionsBuilder, CoreRuntime, WorkerConfigBuilder, init_replay_worker,
|
|
43
|
-
init_worker,
|
|
44
|
-
replay::{HistoryForReplay, ReplayWorkerInput},
|
|
45
|
-
telemetry::{build_otlp_metric_exporter, start_prometheus_metric_exporter},
|
|
46
|
-
};
|
|
47
|
-
use temporal_sdk_core_api::{
|
|
35
|
+
use temporalio_common::{
|
|
48
36
|
Worker as CoreWorker,
|
|
37
|
+
protos::{
|
|
38
|
+
coresdk::{
|
|
39
|
+
FromPayloadsExt, workflow_activation::WorkflowActivation,
|
|
40
|
+
workflow_completion::WorkflowActivationCompletion,
|
|
41
|
+
},
|
|
42
|
+
temporal::api::{
|
|
43
|
+
common::v1::Payload,
|
|
44
|
+
history::v1::History,
|
|
45
|
+
workflowservice::v1::{GetClusterInfoRequest, StartWorkflowExecutionResponse},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
49
48
|
telemetry::{
|
|
50
49
|
Logger, OtelCollectorOptionsBuilder, PrometheusExporterOptions,
|
|
51
50
|
PrometheusExporterOptionsBuilder, TelemetryOptions, TelemetryOptionsBuilder,
|
|
52
51
|
metrics::CoreMeter,
|
|
53
52
|
},
|
|
54
|
-
worker::WorkerVersioningStrategy,
|
|
53
|
+
worker::{WorkerTaskTypes, WorkerVersioningStrategy},
|
|
55
54
|
};
|
|
56
|
-
use
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
temporal::api::{
|
|
62
|
-
common::v1::Payload,
|
|
63
|
-
history::v1::History,
|
|
64
|
-
workflowservice::v1::{GetClusterInfoRequest, StartWorkflowExecutionResponse},
|
|
55
|
+
use temporalio_sdk::{
|
|
56
|
+
IntoActivityFunc, Worker, WorkflowFunction,
|
|
57
|
+
interceptors::{
|
|
58
|
+
FailOnNondeterminismInterceptor, InterceptorWithNext, ReturnWorkflowExitValueInterceptor,
|
|
59
|
+
WorkerInterceptor,
|
|
65
60
|
},
|
|
66
61
|
};
|
|
62
|
+
#[cfg(any(feature = "test-utilities", test))]
|
|
63
|
+
pub(crate) use temporalio_sdk_core::test_help::NAMESPACE;
|
|
64
|
+
use temporalio_sdk_core::{
|
|
65
|
+
ClientOptions, CoreRuntime, RuntimeOptions, RuntimeOptionsBuilder, WorkerConfig,
|
|
66
|
+
WorkerConfigBuilder, init_replay_worker, init_worker,
|
|
67
|
+
replay::{HistoryForReplay, ReplayWorkerInput},
|
|
68
|
+
telemetry::{build_otlp_metric_exporter, start_prometheus_metric_exporter},
|
|
69
|
+
test_help::{MockPollCfg, build_mock_pollers, mock_worker},
|
|
70
|
+
};
|
|
67
71
|
use tokio::{sync::OnceCell, task::AbortHandle};
|
|
68
72
|
use tonic::IntoRequest;
|
|
69
73
|
use tracing::{debug, warn};
|
|
70
74
|
use url::Url;
|
|
71
|
-
|
|
72
|
-
pub(crate) use temporal_sdk_core::test_help::NAMESPACE;
|
|
75
|
+
use uuid::Uuid;
|
|
73
76
|
/// The env var used to specify where the integ tests should point
|
|
74
77
|
pub(crate) const INTEG_SERVER_TARGET_ENV_VAR: &str = "TEMPORAL_SERVICE_ADDRESS";
|
|
75
78
|
pub(crate) const INTEG_NAMESPACE_ENV_VAR: &str = "TEMPORAL_NAMESPACE";
|
|
@@ -107,7 +110,9 @@ pub(crate) fn integ_worker_config(tq: &str) -> WorkerConfigBuilder {
|
|
|
107
110
|
.max_outstanding_workflow_tasks(100_usize)
|
|
108
111
|
.versioning_strategy(WorkerVersioningStrategy::None {
|
|
109
112
|
build_id: "test_build_id".to_owned(),
|
|
110
|
-
})
|
|
113
|
+
})
|
|
114
|
+
.task_types(WorkerTaskTypes::all())
|
|
115
|
+
.skip_client_worker_set_check(true);
|
|
111
116
|
b
|
|
112
117
|
}
|
|
113
118
|
|
|
@@ -148,12 +153,14 @@ where
|
|
|
148
153
|
worker
|
|
149
154
|
}
|
|
150
155
|
|
|
151
|
-
/// Load history from a file containing the protobuf serialization of it
|
|
156
|
+
/// Load history from a file containing the protobuf serialization of it.
|
|
157
|
+
/// File is expected to be a path within `crates/core/tests/histories`
|
|
152
158
|
pub(crate) async fn history_from_proto_binary(
|
|
153
159
|
path_from_root: &str,
|
|
154
160
|
) -> Result<History, anyhow::Error> {
|
|
155
161
|
let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
|
156
|
-
path.push("
|
|
162
|
+
path.push("tests");
|
|
163
|
+
path.push("histories");
|
|
157
164
|
path.push(path_from_root);
|
|
158
165
|
let bytes = tokio::fs::read(path).await?;
|
|
159
166
|
Ok(History::decode(&*bytes)?)
|
|
@@ -170,8 +177,12 @@ pub(crate) fn init_integ_telem() -> Option<&'static CoreRuntime> {
|
|
|
170
177
|
}
|
|
171
178
|
Some(INTEG_TESTS_RT.get_or_init(|| {
|
|
172
179
|
let telemetry_options = get_integ_telem_options();
|
|
180
|
+
let runtime_options = RuntimeOptionsBuilder::default()
|
|
181
|
+
.telemetry_options(telemetry_options)
|
|
182
|
+
.build()
|
|
183
|
+
.expect("Runtime options build cleanly");
|
|
173
184
|
let rt =
|
|
174
|
-
CoreRuntime::new_assume_tokio(
|
|
185
|
+
CoreRuntime::new_assume_tokio(runtime_options).expect("Core runtime inits cleanly");
|
|
175
186
|
if let Some(sub) = rt.telemetry().trace_subscriber() {
|
|
176
187
|
let _ = tracing::subscriber::set_global_default(sub);
|
|
177
188
|
}
|
|
@@ -188,20 +199,19 @@ pub(crate) async fn get_cloud_client() -> RetryClient<Client> {
|
|
|
188
199
|
.replace("\\n", "\n")
|
|
189
200
|
.into_bytes();
|
|
190
201
|
let client_private_key = cloud_key.replace("\\n", "\n").into_bytes();
|
|
191
|
-
let sgo =
|
|
202
|
+
let sgo = ClientOptions::builder()
|
|
192
203
|
.target_url(Url::from_str(&cloud_addr).unwrap())
|
|
193
204
|
.client_name("sdk-core-integ-tests")
|
|
194
205
|
.client_version("clientver")
|
|
195
206
|
.identity("sdk-test-client")
|
|
196
|
-
.
|
|
197
|
-
|
|
207
|
+
.tls_options(TlsOptions {
|
|
208
|
+
client_tls_options: Some(ClientTlsOptions {
|
|
198
209
|
client_cert,
|
|
199
210
|
client_private_key,
|
|
200
211
|
}),
|
|
201
212
|
..Default::default()
|
|
202
213
|
})
|
|
203
|
-
.build()
|
|
204
|
-
.unwrap();
|
|
214
|
+
.build();
|
|
205
215
|
sgo.connect(
|
|
206
216
|
env::var("TEMPORAL_NAMESPACE").expect("TEMPORAL_NAMESPACE must be set"),
|
|
207
217
|
None,
|
|
@@ -230,11 +240,11 @@ struct InitializedWorker {
|
|
|
230
240
|
impl CoreWfStarter {
|
|
231
241
|
pub(crate) fn new(test_name: &str) -> Self {
|
|
232
242
|
init_integ_telem();
|
|
233
|
-
Self::
|
|
243
|
+
Self::new_with_overrides(test_name, None, None)
|
|
234
244
|
}
|
|
235
245
|
|
|
236
246
|
pub(crate) fn new_with_runtime(test_name: &str, runtime: CoreRuntime) -> Self {
|
|
237
|
-
Self::
|
|
247
|
+
Self::new_with_overrides(test_name, Some(runtime), None)
|
|
238
248
|
}
|
|
239
249
|
|
|
240
250
|
/// Targets cloud if the required env vars are present. Otherwise, local server (but only if
|
|
@@ -250,7 +260,7 @@ impl CoreWfStarter {
|
|
|
250
260
|
check_mlsv = true;
|
|
251
261
|
None
|
|
252
262
|
};
|
|
253
|
-
let mut s = Self::
|
|
263
|
+
let mut s = Self::new_with_overrides(test_name, None, client);
|
|
254
264
|
|
|
255
265
|
if check_mlsv && !version_req.is_empty() {
|
|
256
266
|
let clustinfo = (*s.get_client().await)
|
|
@@ -281,7 +291,7 @@ impl CoreWfStarter {
|
|
|
281
291
|
Some(s)
|
|
282
292
|
}
|
|
283
293
|
|
|
284
|
-
fn
|
|
294
|
+
pub(crate) fn new_with_overrides(
|
|
285
295
|
test_name: &str,
|
|
286
296
|
runtime_override: Option<CoreRuntime>,
|
|
287
297
|
client_override: Option<RetryClient<Client>>,
|
|
@@ -319,8 +329,7 @@ impl CoreWfStarter {
|
|
|
319
329
|
|
|
320
330
|
pub(crate) async fn worker(&mut self) -> TestWorker {
|
|
321
331
|
let w = self.get_worker().await;
|
|
322
|
-
let
|
|
323
|
-
let mut w = TestWorker::new(w, tq);
|
|
332
|
+
let mut w = TestWorker::new(w);
|
|
324
333
|
w.client = Some(self.get_client().await);
|
|
325
334
|
|
|
326
335
|
w
|
|
@@ -431,7 +440,7 @@ impl CoreWfStarter {
|
|
|
431
440
|
.unwrap()
|
|
432
441
|
.client
|
|
433
442
|
.get_untyped_workflow_handle(self.get_wf_id().to_string(), "")
|
|
434
|
-
.get_workflow_result(
|
|
443
|
+
.get_workflow_result(GetWorkflowResultOptions { follow_runs: false })
|
|
435
444
|
.await
|
|
436
445
|
}
|
|
437
446
|
|
|
@@ -441,7 +450,7 @@ impl CoreWfStarter {
|
|
|
441
450
|
let rt = if let Some(ref rto) = self.runtime_override {
|
|
442
451
|
rto
|
|
443
452
|
} else {
|
|
444
|
-
|
|
453
|
+
init_integ_telem().unwrap()
|
|
445
454
|
};
|
|
446
455
|
let cfg = self
|
|
447
456
|
.worker_config
|
|
@@ -482,8 +491,11 @@ pub(crate) struct TestWorker {
|
|
|
482
491
|
}
|
|
483
492
|
impl TestWorker {
|
|
484
493
|
/// Create a new test worker
|
|
485
|
-
pub(crate) fn new(core_worker: Arc<dyn CoreWorker
|
|
486
|
-
let inner = Worker::new_from_core(
|
|
494
|
+
pub(crate) fn new(core_worker: Arc<dyn CoreWorker>) -> Self {
|
|
495
|
+
let inner = Worker::new_from_core(
|
|
496
|
+
core_worker.clone(),
|
|
497
|
+
core_worker.get_config().task_queue.clone(),
|
|
498
|
+
);
|
|
487
499
|
Self {
|
|
488
500
|
inner,
|
|
489
501
|
core_worker,
|
|
@@ -497,6 +509,10 @@ impl TestWorker {
|
|
|
497
509
|
&mut self.inner
|
|
498
510
|
}
|
|
499
511
|
|
|
512
|
+
pub(crate) fn worker_instance_key(&self) -> Uuid {
|
|
513
|
+
self.core_worker.worker_instance_key()
|
|
514
|
+
}
|
|
515
|
+
|
|
500
516
|
// TODO: Maybe trait-ify?
|
|
501
517
|
pub(crate) fn register_wf<F: Into<WorkflowFunction>>(
|
|
502
518
|
&mut self,
|
|
@@ -744,30 +760,30 @@ pub(crate) fn get_integ_server_options() -> ClientOptions {
|
|
|
744
760
|
let temporal_server_address = env::var(INTEG_SERVER_TARGET_ENV_VAR)
|
|
745
761
|
.unwrap_or_else(|_| "http://localhost:7233".to_owned());
|
|
746
762
|
let url = Url::try_from(&*temporal_server_address).unwrap();
|
|
747
|
-
let
|
|
748
|
-
|
|
763
|
+
let api_key = env::var(INTEG_API_KEY)
|
|
764
|
+
.ok()
|
|
765
|
+
.map(|key_file| std::fs::read_to_string(key_file).unwrap());
|
|
766
|
+
let tls_cfg = get_integ_tls_config();
|
|
767
|
+
|
|
768
|
+
ClientOptions::builder()
|
|
769
|
+
.identity(INTEG_CLIENT_IDENTITY.to_string())
|
|
749
770
|
.target_url(url)
|
|
750
771
|
.client_name(INTEG_CLIENT_NAME.to_string())
|
|
751
|
-
.client_version(INTEG_CLIENT_VERSION.to_string())
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
}
|
|
756
|
-
if let Some(tls) = get_integ_tls_config() {
|
|
757
|
-
cb.tls_cfg(tls);
|
|
758
|
-
};
|
|
759
|
-
cb.build().unwrap()
|
|
772
|
+
.client_version(INTEG_CLIENT_VERSION.to_string())
|
|
773
|
+
.maybe_api_key(api_key)
|
|
774
|
+
.maybe_tls_options(tls_cfg)
|
|
775
|
+
.build()
|
|
760
776
|
}
|
|
761
777
|
|
|
762
|
-
pub(crate) fn get_integ_tls_config() -> Option<
|
|
778
|
+
pub(crate) fn get_integ_tls_config() -> Option<TlsOptions> {
|
|
763
779
|
if env::var(INTEG_USE_TLS_ENV_VAR).is_ok() {
|
|
764
780
|
let root = std::fs::read("../.cloud_certs/ca.pem").unwrap();
|
|
765
781
|
let client_cert = std::fs::read("../.cloud_certs/client.pem").unwrap();
|
|
766
782
|
let client_private_key = std::fs::read("../.cloud_certs/client.key").unwrap();
|
|
767
|
-
Some(
|
|
783
|
+
Some(TlsOptions {
|
|
768
784
|
server_root_ca_cert: Some(root),
|
|
769
785
|
domain: None,
|
|
770
|
-
|
|
786
|
+
client_tls_options: Some(ClientTlsOptions {
|
|
771
787
|
client_cert,
|
|
772
788
|
client_private_key,
|
|
773
789
|
}),
|
|
@@ -780,7 +796,7 @@ pub(crate) fn get_integ_tls_config() -> Option<TlsConfig> {
|
|
|
780
796
|
pub(crate) fn get_integ_telem_options() -> TelemetryOptions {
|
|
781
797
|
let mut ob = TelemetryOptionsBuilder::default();
|
|
782
798
|
let filter_string =
|
|
783
|
-
env::var("RUST_LOG").unwrap_or_else(|_| "INFO,
|
|
799
|
+
env::var("RUST_LOG").unwrap_or_else(|_| "INFO,temporalio_sdk_core=INFO".to_string());
|
|
784
800
|
if let Some(url) = env::var(OTEL_URL_ENV_VAR)
|
|
785
801
|
.ok()
|
|
786
802
|
.map(|x| x.parse::<Url>().unwrap())
|
|
@@ -811,6 +827,13 @@ pub(crate) fn get_integ_telem_options() -> TelemetryOptions {
|
|
|
811
827
|
.unwrap()
|
|
812
828
|
}
|
|
813
829
|
|
|
830
|
+
pub(crate) fn get_integ_runtime_options(telemopts: TelemetryOptions) -> RuntimeOptions {
|
|
831
|
+
RuntimeOptionsBuilder::default()
|
|
832
|
+
.telemetry_options(telemopts)
|
|
833
|
+
.build()
|
|
834
|
+
.unwrap()
|
|
835
|
+
}
|
|
836
|
+
|
|
814
837
|
#[async_trait::async_trait(?Send)]
|
|
815
838
|
pub(crate) trait WorkflowHandleExt {
|
|
816
839
|
async fn fetch_history_and_replay(
|
|
@@ -907,19 +930,14 @@ where
|
|
|
907
930
|
}
|
|
908
931
|
}
|
|
909
932
|
|
|
910
|
-
|
|
911
|
-
WorkerConfig,
|
|
912
|
-
test_help::{MockPollCfg, build_mock_pollers, mock_worker},
|
|
913
|
-
};
|
|
914
|
-
|
|
915
|
-
pub(crate) fn build_fake_sdk(mock_cfg: MockPollCfg) -> temporal_sdk::Worker {
|
|
933
|
+
pub(crate) fn build_fake_sdk(mock_cfg: MockPollCfg) -> temporalio_sdk::Worker {
|
|
916
934
|
let mut mock = build_mock_pollers(mock_cfg);
|
|
917
935
|
mock.worker_cfg(|c| {
|
|
918
936
|
c.max_cached_workflows = 1;
|
|
919
937
|
c.ignore_evicts_on_shutdown = false;
|
|
920
938
|
});
|
|
921
939
|
let core = mock_worker(mock);
|
|
922
|
-
let mut worker =
|
|
940
|
+
let mut worker = temporalio_sdk::Worker::new_from_core(Arc::new(core), "replay_q".to_string());
|
|
923
941
|
worker.set_worker_interceptor(FailOnNondeterminismInterceptor {});
|
|
924
942
|
worker
|
|
925
943
|
}
|
|
@@ -936,10 +954,7 @@ pub(crate) fn mock_sdk_cfg(
|
|
|
936
954
|
let mut mock = build_mock_pollers(poll_cfg);
|
|
937
955
|
mock.worker_cfg(mutator);
|
|
938
956
|
let core = mock_worker(mock);
|
|
939
|
-
TestWorker::new(
|
|
940
|
-
Arc::new(core),
|
|
941
|
-
temporal_sdk_core::test_help::TEST_Q.to_string(),
|
|
942
|
-
)
|
|
957
|
+
TestWorker::new(Arc::new(core))
|
|
943
958
|
}
|
|
944
959
|
|
|
945
960
|
#[derive(Default)]
|
|
@@ -982,7 +997,7 @@ impl Drop for ActivationAssertionsInterceptor {
|
|
|
982
997
|
}
|
|
983
998
|
|
|
984
999
|
#[cfg(feature = "ephemeral-server")]
|
|
985
|
-
use
|
|
1000
|
+
use temporalio_sdk_core::ephemeral_server::{
|
|
986
1001
|
EphemeralExe, EphemeralExeVersion, TemporalDevServerConfigBuilder, default_cached_download,
|
|
987
1002
|
};
|
|
988
1003
|
|
|
@@ -1014,6 +1029,10 @@ pub(crate) fn integ_dev_server_config(
|
|
|
1014
1029
|
"system.enableDeploymentVersions=true".to_owned(),
|
|
1015
1030
|
"--dynamic-config-value".to_owned(),
|
|
1016
1031
|
"component.nexusoperations.recordCancelRequestCompletionEvents=true".to_owned(),
|
|
1032
|
+
"--dynamic-config-value".to_owned(),
|
|
1033
|
+
"frontend.WorkerHeartbeatsEnabled=true".to_owned(),
|
|
1034
|
+
"--dynamic-config-value".to_owned(),
|
|
1035
|
+
"frontend.ListWorkersEnabled=true".to_owned(),
|
|
1017
1036
|
"--search-attribute".to_string(),
|
|
1018
1037
|
format!("{SEARCH_ATTR_TXT}=Text"),
|
|
1019
1038
|
"--search-attribute".to_string(),
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
use std::time::Duration;
|
|
2
|
-
use
|
|
3
|
-
|
|
4
|
-
coresdk::AsJsonPayloadExt,
|
|
2
|
+
use temporalio_common::{
|
|
3
|
+
prost_dur,
|
|
4
|
+
protos::{coresdk::AsJsonPayloadExt, temporal::api::common::v1::RetryPolicy},
|
|
5
5
|
};
|
|
6
|
+
use temporalio_sdk::{ActivityOptions, LocalActivityOptions, WfContext, WorkflowResult};
|
|
6
7
|
|
|
7
8
|
pub(crate) async fn la_problem_workflow(ctx: WfContext) -> WorkflowResult<()> {
|
|
8
9
|
ctx.local_activity(LocalActivityOptions {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
error: Duplicate transitions are not allowed!
|
|
2
|
+
--> tests/fsm_trybuild/dupe_transitions_fail.rs:3:1
|
|
3
|
+
|
|
|
4
|
+
3 | / fsm! {
|
|
5
|
+
4 | | name SimpleMachine; command SimpleMachineCommand; error Infallible;
|
|
6
|
+
5 | |
|
|
7
|
+
6 | | One --(A)--> Two;
|
|
8
|
+
7 | | One --(A)--> Two;
|
|
9
|
+
8 | | }
|
|
10
|
+
| |_^
|
|
11
|
+
|
|
|
12
|
+
= note: this error originates in the macro `fsm` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
#![allow(dead_code)]
|
|
2
2
|
|
|
3
|
-
extern crate rustfsm_trait as rustfsm;
|
|
4
|
-
|
|
5
|
-
use rustfsm_procmacro::fsm;
|
|
6
|
-
use rustfsm_trait::TransitionResult;
|
|
7
3
|
use std::convert::Infallible;
|
|
4
|
+
use temporalio_common::fsm_trait::TransitionResult;
|
|
5
|
+
use temporalio_macros::fsm;
|
|
8
6
|
|
|
9
7
|
fsm! {
|
|
10
8
|
name SimpleMachine; command SimpleMachineCommand; error Infallible;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
error: expected `name`
|
|
2
|
-
-->
|
|
2
|
+
--> tests/fsm_trybuild/forgot_name_fail.rs:4:5
|
|
3
3
|
|
|
|
4
|
-
|
|
4
|
+
4 | One --(A)--> Two
|
|
5
5
|
| ^^^
|
|
6
6
|
|
|
7
7
|
error: The fsm definition should begin with `name MachineName; command CommandType; error ErrorType;` optionally followed by `shared_state SharedStateType;`
|
|
8
|
-
-->
|
|
8
|
+
--> tests/fsm_trybuild/forgot_name_fail.rs:4:5
|
|
9
9
|
|
|
|
10
|
-
|
|
10
|
+
4 | One --(A)--> Two
|
|
11
11
|
| ^^^
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
extern crate rustfsm_trait as rustfsm;
|
|
2
|
-
|
|
3
|
-
use rustfsm_procmacro::fsm;
|
|
4
|
-
use rustfsm_trait::TransitionResult;
|
|
5
1
|
use std::convert::Infallible;
|
|
2
|
+
use temporalio_common::fsm_trait::TransitionResult;
|
|
3
|
+
use temporalio_macros::fsm;
|
|
6
4
|
|
|
7
5
|
fsm! {
|
|
8
6
|
name Simple; command SimpleCommand; error Infallible;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
extern crate rustfsm_trait as rustfsm;
|
|
2
|
-
|
|
3
|
-
use rustfsm_procmacro::fsm;
|
|
4
|
-
use rustfsm_trait::TransitionResult;
|
|
5
1
|
use std::convert::Infallible;
|
|
2
|
+
use temporalio_common::fsm_trait::TransitionResult;
|
|
3
|
+
use temporalio_macros::fsm;
|
|
6
4
|
|
|
7
5
|
fsm! {
|
|
8
6
|
name Simple; command SimpleCommand; error Infallible;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
#![allow(dead_code)]
|
|
2
2
|
|
|
3
|
-
extern crate rustfsm_trait as rustfsm;
|
|
4
|
-
|
|
5
|
-
use rustfsm_procmacro::fsm;
|
|
6
|
-
use rustfsm_trait::TransitionResult;
|
|
7
3
|
use std::convert::Infallible;
|
|
4
|
+
use temporalio_common::fsm_trait::TransitionResult;
|
|
5
|
+
use temporalio_macros::fsm;
|
|
8
6
|
|
|
9
7
|
fsm! {
|
|
10
8
|
name SimpleMachine; command SimpleMachineCommand; error Infallible;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
extern crate rustfsm_trait as rustfsm;
|
|
2
|
-
|
|
3
|
-
use rustfsm_procmacro::fsm;
|
|
4
|
-
use rustfsm_trait::TransitionResult;
|
|
5
1
|
use std::convert::Infallible;
|
|
2
|
+
use temporalio_common::fsm_trait::TransitionResult;
|
|
3
|
+
use temporalio_macros::fsm;
|
|
6
4
|
|
|
7
5
|
fsm! {
|
|
8
6
|
name SimpleMachine; command SimpleMachineCommand; error Infallible;
|
package/sdk-core/crates/sdk-core/tests/fsm_trybuild/no_handle_conversions_require_into_fail.stderr
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
error[E0277]: the trait bound `One: From<Two>` is not satisfied
|
|
2
|
+
--> tests/fsm_trybuild/no_handle_conversions_require_into_fail.rs:9:5
|
|
3
|
+
|
|
|
4
|
+
9 | Two --(B)--> One;
|
|
5
|
+
| ^^^ the trait `From<Two>` is not implemented for `One`
|
|
6
|
+
|
|
|
7
|
+
= note: required for `Two` to implement `Into<One>`
|
|
8
|
+
note: required by a bound in `TransitionResult::<Sm, Ds>::from`
|
|
9
|
+
--> $WORKSPACE/crates/common/src/fsm_trait.rs
|
|
10
|
+
|
|
|
11
|
+
| pub fn from<CurrentState>(current_state: CurrentState) -> Self
|
|
12
|
+
| ---- required by a bound in this associated function
|
|
13
|
+
| where
|
|
14
|
+
| CurrentState: Into<Ds>,
|
|
15
|
+
| ^^^^^^^^ required by this bound in `TransitionResult::<Sm, Ds>::from`
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
extern crate rustfsm_trait as rustfsm;
|
|
2
|
-
|
|
3
|
-
use rustfsm_procmacro::fsm;
|
|
4
|
-
use rustfsm_trait::TransitionResult;
|
|
5
1
|
use std::convert::Infallible;
|
|
2
|
+
use temporalio_common::fsm_trait::TransitionResult;
|
|
3
|
+
use temporalio_macros::fsm;
|
|
6
4
|
|
|
7
5
|
fsm! {
|
|
8
6
|
name SimpleMachine; command SimpleMachineCommand; error Infallible;
|