@temporalio/core-bridge 1.15.0 → 1.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.lock +172 -70
- package/lib/native.d.ts +1 -1
- package/package.json +2 -2
- package/releases/aarch64-apple-darwin/index.node +0 -0
- package/releases/aarch64-unknown-linux-gnu/index.node +0 -0
- package/releases/x86_64-apple-darwin/index.node +0 -0
- package/releases/x86_64-pc-windows-msvc/index.node +0 -0
- package/releases/x86_64-unknown-linux-gnu/index.node +0 -0
- package/sdk-core/.github/workflows/per-pr.yml +6 -6
- package/sdk-core/AGENTS.md +41 -30
- package/sdk-core/Cargo.toml +3 -0
- package/sdk-core/README.md +15 -9
- package/sdk-core/crates/client/Cargo.toml +4 -0
- package/sdk-core/crates/client/README.md +139 -0
- package/sdk-core/crates/client/src/async_activity_handle.rs +297 -0
- package/sdk-core/crates/client/src/callback_based.rs +7 -0
- package/sdk-core/crates/client/src/errors.rs +294 -0
- package/sdk-core/crates/client/src/{raw.rs → grpc.rs} +280 -159
- package/sdk-core/crates/client/src/lib.rs +920 -1326
- package/sdk-core/crates/client/src/metrics.rs +24 -33
- package/sdk-core/crates/client/src/options_structs.rs +457 -0
- package/sdk-core/crates/client/src/replaceable.rs +5 -4
- package/sdk-core/crates/client/src/request_extensions.rs +8 -9
- package/sdk-core/crates/client/src/retry.rs +99 -54
- package/sdk-core/crates/client/src/{worker/mod.rs → worker.rs} +1 -1
- package/sdk-core/crates/client/src/workflow_handle.rs +826 -0
- package/sdk-core/crates/common/Cargo.toml +61 -2
- package/sdk-core/crates/common/build.rs +742 -12
- package/sdk-core/crates/common/protos/api_upstream/.github/workflows/ci.yml +2 -0
- package/sdk-core/crates/common/protos/api_upstream/Makefile +2 -1
- package/sdk-core/crates/common/protos/api_upstream/buf.yaml +0 -3
- package/sdk-core/crates/common/protos/api_upstream/cmd/check-path-conflicts/main.go +137 -0
- package/sdk-core/crates/common/protos/api_upstream/openapi/openapiv2.json +1166 -770
- package/sdk-core/crates/common/protos/api_upstream/openapi/openapiv3.yaml +1243 -750
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/deployment/v1/message.proto +2 -2
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/enums/v1/workflow.proto +4 -3
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/failure/v1/message.proto +1 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/history/v1/message.proto +4 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/namespace/v1/message.proto +6 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/nexus/v1/message.proto +16 -1
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +64 -6
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +88 -33
- package/sdk-core/crates/common/protos/local/temporal/sdk/core/nexus/nexus.proto +4 -2
- package/sdk-core/crates/common/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +4 -0
- package/sdk-core/crates/common/protos/local/temporal/sdk/core/workflow_commands/workflow_commands.proto +5 -5
- package/sdk-core/crates/common/src/activity_definition.rs +20 -0
- package/sdk-core/crates/common/src/data_converters.rs +770 -0
- package/sdk-core/crates/common/src/envconfig.rs +5 -0
- package/sdk-core/crates/common/src/lib.rs +15 -211
- package/sdk-core/crates/common/src/payload_visitor.rs +648 -0
- package/sdk-core/crates/common/src/priority.rs +110 -0
- package/sdk-core/crates/common/src/protos/canned_histories.rs +3 -0
- package/sdk-core/crates/common/src/protos/history_builder.rs +45 -0
- package/sdk-core/crates/common/src/protos/history_info.rs +2 -0
- package/sdk-core/crates/common/src/protos/mod.rs +122 -27
- package/sdk-core/crates/common/src/protos/task_token.rs +3 -3
- package/sdk-core/crates/common/src/protos/utilities.rs +11 -0
- package/sdk-core/crates/{sdk-core → common}/src/telemetry/log_export.rs +5 -7
- package/sdk-core/crates/common/src/telemetry/metrics/core.rs +125 -0
- package/sdk-core/crates/common/src/telemetry/metrics.rs +268 -223
- package/sdk-core/crates/{sdk-core → common}/src/telemetry/otel.rs +8 -13
- package/sdk-core/crates/{sdk-core → common}/src/telemetry/prometheus_meter.rs +49 -50
- package/sdk-core/crates/{sdk-core → common}/src/telemetry/prometheus_server.rs +2 -3
- package/sdk-core/crates/common/src/telemetry.rs +264 -4
- package/sdk-core/crates/common/src/worker.rs +68 -603
- package/sdk-core/crates/common/src/workflow_definition.rs +60 -0
- package/sdk-core/crates/macros/Cargo.toml +5 -1
- package/sdk-core/crates/macros/src/activities_definitions.rs +585 -0
- package/sdk-core/crates/macros/src/fsm_impl.rs +507 -0
- package/sdk-core/crates/macros/src/lib.rs +138 -512
- package/sdk-core/crates/macros/src/macro_utils.rs +106 -0
- package/sdk-core/crates/macros/src/workflow_definitions.rs +1224 -0
- package/sdk-core/crates/sdk/Cargo.toml +19 -6
- package/sdk-core/crates/sdk/README.md +415 -0
- package/sdk-core/crates/sdk/src/activities.rs +417 -0
- package/sdk-core/crates/sdk/src/interceptors.rs +1 -1
- package/sdk-core/crates/sdk/src/lib.rs +757 -442
- package/sdk-core/crates/sdk/src/workflow_context/options.rs +45 -35
- package/sdk-core/crates/sdk/src/workflow_context.rs +1033 -289
- package/sdk-core/crates/sdk/src/workflow_future.rs +277 -213
- package/sdk-core/crates/sdk/src/workflows.rs +711 -0
- package/sdk-core/crates/sdk-core/Cargo.toml +57 -64
- package/sdk-core/crates/sdk-core/benches/workflow_replay_bench.rs +41 -35
- package/sdk-core/crates/sdk-core/machine_coverage/ActivityMachine_Coverage.puml +1 -1
- package/sdk-core/crates/sdk-core/src/abstractions.rs +6 -10
- package/sdk-core/crates/sdk-core/src/core_tests/activity_tasks.rs +6 -5
- package/sdk-core/crates/sdk-core/src/core_tests/mod.rs +13 -15
- package/sdk-core/crates/sdk-core/src/core_tests/queries.rs +21 -25
- package/sdk-core/crates/sdk-core/src/core_tests/replay_flag.rs +7 -10
- package/sdk-core/crates/sdk-core/src/core_tests/updates.rs +14 -17
- package/sdk-core/crates/sdk-core/src/core_tests/workers.rs +493 -26
- package/sdk-core/crates/sdk-core/src/core_tests/workflow_tasks.rs +4 -8
- package/sdk-core/crates/sdk-core/src/ephemeral_server/mod.rs +7 -7
- package/sdk-core/crates/sdk-core/src/histfetch.rs +20 -10
- package/sdk-core/crates/sdk-core/src/lib.rs +41 -111
- package/sdk-core/crates/sdk-core/src/pollers/mod.rs +4 -9
- package/sdk-core/crates/sdk-core/src/pollers/poll_buffer.rs +118 -19
- package/sdk-core/crates/sdk-core/src/protosext/mod.rs +2 -2
- package/sdk-core/crates/sdk-core/src/replay/mod.rs +14 -5
- package/sdk-core/crates/sdk-core/src/telemetry/metrics.rs +179 -196
- package/sdk-core/crates/sdk-core/src/telemetry/mod.rs +3 -280
- package/sdk-core/crates/sdk-core/src/test_help/integ_helpers.rs +6 -9
- package/sdk-core/crates/sdk-core/src/test_help/unit_helpers.rs +3 -6
- package/sdk-core/crates/sdk-core/src/worker/activities/local_activities.rs +11 -14
- package/sdk-core/crates/sdk-core/src/worker/activities.rs +16 -19
- package/sdk-core/crates/sdk-core/src/worker/client/mocks.rs +9 -5
- package/sdk-core/crates/sdk-core/src/worker/client.rs +103 -81
- package/sdk-core/crates/sdk-core/src/worker/heartbeat.rs +7 -11
- package/sdk-core/crates/sdk-core/src/worker/mod.rs +1124 -229
- package/sdk-core/crates/sdk-core/src/worker/nexus.rs +145 -23
- package/sdk-core/crates/sdk-core/src/worker/slot_provider.rs +2 -2
- package/sdk-core/crates/sdk-core/src/worker/tuner/fixed_size.rs +2 -2
- package/sdk-core/crates/sdk-core/src/worker/tuner/resource_based.rs +13 -13
- package/sdk-core/crates/sdk-core/src/worker/tuner.rs +28 -8
- package/sdk-core/crates/sdk-core/src/worker/workflow/driven_workflow.rs +9 -3
- package/sdk-core/crates/sdk-core/src/worker/workflow/machines/upsert_search_attributes_state_machine.rs +21 -22
- package/sdk-core/crates/sdk-core/src/worker/workflow/machines/workflow_machines.rs +19 -4
- package/sdk-core/crates/sdk-core/src/worker/workflow/managed_run.rs +14 -18
- package/sdk-core/crates/sdk-core/src/worker/workflow/mod.rs +4 -6
- package/sdk-core/crates/sdk-core/src/worker/workflow/run_cache.rs +4 -7
- package/sdk-core/crates/sdk-core/src/worker/workflow/wft_extraction.rs +2 -4
- package/sdk-core/crates/sdk-core/src/worker/workflow/wft_poller.rs +8 -9
- package/sdk-core/crates/sdk-core/src/worker/workflow/workflow_stream.rs +1 -3
- package/sdk-core/crates/sdk-core/tests/activities_procmacro.rs +6 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/basic_pass.rs +54 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/invalid_self_type_fail.rs +18 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/invalid_self_type_fail.stderr +5 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/missing_context_fail.rs +14 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/missing_context_fail.stderr +5 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/multi_arg_pass.rs +48 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/no_input_pass.rs +14 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/no_return_type_pass.rs +19 -0
- package/sdk-core/crates/sdk-core/tests/cloud_tests.rs +14 -5
- package/sdk-core/crates/sdk-core/tests/common/activity_functions.rs +55 -0
- package/sdk-core/crates/sdk-core/tests/common/mod.rs +241 -196
- package/sdk-core/crates/sdk-core/tests/common/workflows.rs +41 -28
- package/sdk-core/crates/sdk-core/tests/global_metric_tests.rs +3 -5
- package/sdk-core/crates/sdk-core/tests/heavy_tests/fuzzy_workflow.rs +73 -64
- package/sdk-core/crates/sdk-core/tests/heavy_tests.rs +298 -252
- package/sdk-core/crates/sdk-core/tests/integ_tests/async_activity_client_tests.rs +230 -0
- package/sdk-core/crates/sdk-core/tests/integ_tests/client_tests.rs +94 -57
- package/sdk-core/crates/sdk-core/tests/integ_tests/data_converter_tests.rs +381 -0
- package/sdk-core/crates/sdk-core/tests/integ_tests/ephemeral_server_tests.rs +16 -12
- package/sdk-core/crates/sdk-core/tests/integ_tests/heartbeat_tests.rs +48 -40
- package/sdk-core/crates/sdk-core/tests/integ_tests/metrics_tests.rs +327 -255
- package/sdk-core/crates/sdk-core/tests/integ_tests/pagination_tests.rs +50 -45
- package/sdk-core/crates/sdk-core/tests/integ_tests/polling_tests.rs +147 -126
- package/sdk-core/crates/sdk-core/tests/integ_tests/queries_tests.rs +103 -89
- package/sdk-core/crates/sdk-core/tests/integ_tests/update_tests.rs +609 -453
- package/sdk-core/crates/sdk-core/tests/integ_tests/visibility_tests.rs +80 -62
- package/sdk-core/crates/sdk-core/tests/integ_tests/worker_heartbeat_tests.rs +360 -231
- package/sdk-core/crates/sdk-core/tests/integ_tests/worker_tests.rs +248 -185
- package/sdk-core/crates/sdk-core/tests/integ_tests/worker_versioning_tests.rs +52 -43
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_client_tests.rs +180 -0
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/activities.rs +428 -315
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/cancel_external.rs +82 -56
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/cancel_wf.rs +56 -28
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/child_workflows.rs +364 -243
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/client_interactions.rs +552 -0
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/continue_as_new.rs +101 -42
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/determinism.rs +243 -147
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/eager.rs +98 -28
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/local_activities.rs +1475 -1036
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/modify_wf_properties.rs +73 -41
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/nexus.rs +397 -238
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/patches.rs +414 -189
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/queries.rs +415 -0
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/replay.rs +96 -36
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/resets.rs +154 -137
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/signals.rs +183 -105
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/stickyness.rs +85 -38
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/timers.rs +142 -40
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/upsert_search_attrs.rs +73 -54
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests.rs +363 -226
- package/sdk-core/crates/sdk-core/tests/main.rs +17 -15
- package/sdk-core/crates/sdk-core/tests/manual_tests.rs +207 -152
- package/sdk-core/crates/sdk-core/tests/shared_tests/mod.rs +65 -34
- package/sdk-core/crates/sdk-core/tests/shared_tests/priority.rs +107 -84
- package/sdk-core/crates/sdk-core/tests/workflows_procmacro.rs +6 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/async_query_fail.rs +26 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/async_query_fail.stderr +5 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/basic_pass.rs +49 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/minimal_pass.rs +21 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/mut_query_fail.rs +26 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/mut_query_fail.stderr +5 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/sync_run_fail.rs +21 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/sync_run_fail.stderr +5 -0
- package/sdk-core/crates/sdk-core-c-bridge/Cargo.toml +7 -1
- package/sdk-core/crates/sdk-core-c-bridge/include/temporal-sdk-core-c-bridge.h +14 -14
- package/sdk-core/crates/sdk-core-c-bridge/src/client.rs +83 -74
- package/sdk-core/crates/sdk-core-c-bridge/src/metric.rs +9 -14
- package/sdk-core/crates/sdk-core-c-bridge/src/runtime.rs +1 -2
- package/sdk-core/crates/sdk-core-c-bridge/src/tests/context.rs +13 -13
- package/sdk-core/crates/sdk-core-c-bridge/src/tests/mod.rs +6 -6
- package/sdk-core/crates/sdk-core-c-bridge/src/tests/utils.rs +3 -4
- package/sdk-core/crates/sdk-core-c-bridge/src/worker.rs +62 -75
- package/sdk-core/rustfmt.toml +2 -1
- package/src/client.rs +205 -318
- package/src/metrics.rs +22 -30
- package/src/runtime.rs +4 -5
- package/src/worker.rs +16 -19
- package/ts/native.ts +1 -1
- package/sdk-core/crates/client/src/workflow_handle/mod.rs +0 -212
- package/sdk-core/crates/common/src/errors.rs +0 -85
- package/sdk-core/crates/common/tests/worker_task_types_test.rs +0 -129
- package/sdk-core/crates/sdk/src/activity_context.rs +0 -238
- package/sdk-core/crates/sdk/src/app_data.rs +0 -37
- package/sdk-core/crates/sdk-core/tests/integ_tests/activity_functions.rs +0 -5
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/appdata_propagation.rs +0 -61
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
//! Shared tests that are meant to be run against both local dev server and cloud
|
|
2
2
|
|
|
3
3
|
use crate::common::CoreWfStarter;
|
|
4
|
-
use std::sync::
|
|
4
|
+
use std::sync::{
|
|
5
|
+
Arc,
|
|
6
|
+
atomic::{AtomicBool, Ordering::Relaxed},
|
|
7
|
+
};
|
|
5
8
|
use temporalio_common::{
|
|
6
9
|
protos::temporal::api::{
|
|
7
10
|
enums::v1::{EventType, WorkflowTaskFailedCause::GrpcMessageTooLarge},
|
|
@@ -11,53 +14,81 @@ use temporalio_common::{
|
|
|
11
14
|
},
|
|
12
15
|
worker::WorkerTaskTypes,
|
|
13
16
|
};
|
|
14
|
-
use
|
|
17
|
+
use temporalio_macros::{workflow, workflow_methods};
|
|
18
|
+
use temporalio_sdk::{WorkflowContext, WorkflowResult};
|
|
15
19
|
|
|
16
20
|
pub(crate) mod priority;
|
|
17
21
|
|
|
22
|
+
#[workflow]
|
|
23
|
+
struct OversizeGrpcMessageWf {
|
|
24
|
+
run_flag: Arc<AtomicBool>,
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
#[workflow_methods(factory_only)]
|
|
28
|
+
impl OversizeGrpcMessageWf {
|
|
29
|
+
#[run]
|
|
30
|
+
async fn run(ctx: &mut WorkflowContext<Self>) -> WorkflowResult<Vec<u8>> {
|
|
31
|
+
if ctx.state(|wf| wf.run_flag.load(Relaxed)) {
|
|
32
|
+
Ok(vec![])
|
|
33
|
+
} else {
|
|
34
|
+
ctx.state(|wf| wf.run_flag.store(true, Relaxed));
|
|
35
|
+
let result: Vec<u8> = vec![0; 5000000];
|
|
36
|
+
Ok(result)
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
18
41
|
pub(crate) async fn grpc_message_too_large() {
|
|
42
|
+
let run_flag = Arc::new(AtomicBool::new(false));
|
|
43
|
+
let run_flag_clone = run_flag.clone();
|
|
44
|
+
|
|
19
45
|
let wf_name = "oversize_grpc_message";
|
|
20
46
|
let mut starter = CoreWfStarter::new_cloud_or_local(wf_name, "")
|
|
21
47
|
.await
|
|
22
48
|
.unwrap();
|
|
23
|
-
starter.
|
|
24
|
-
|
|
49
|
+
starter.sdk_config.task_types = WorkerTaskTypes::workflow_only();
|
|
50
|
+
starter
|
|
51
|
+
.sdk_config
|
|
52
|
+
.register_workflow_with_factory(move || OversizeGrpcMessageWf {
|
|
53
|
+
run_flag: run_flag_clone.clone(),
|
|
54
|
+
});
|
|
25
55
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
});
|
|
36
|
-
starter.start_with_worker(wf_name, &mut core).await;
|
|
37
|
-
core.run_until_done().await.unwrap();
|
|
56
|
+
let mut sdk = starter.worker().await;
|
|
57
|
+
sdk.submit_workflow(
|
|
58
|
+
OversizeGrpcMessageWf::run,
|
|
59
|
+
(),
|
|
60
|
+
starter.workflow_options.clone(),
|
|
61
|
+
)
|
|
62
|
+
.await
|
|
63
|
+
.unwrap();
|
|
64
|
+
sdk.run_until_done().await.unwrap();
|
|
38
65
|
|
|
39
66
|
let events = starter.get_history().await.events;
|
|
40
67
|
// Depending on the version of server, it may terminate the workflow, or simply be a task
|
|
41
68
|
// failure
|
|
42
69
|
assert!(
|
|
43
|
-
events.iter().any(
|
|
44
|
-
// Task failure
|
|
45
|
-
e.event_type == EventType::WorkflowTaskFailed as i32
|
|
46
|
-
&& if let WorkflowTaskFailedEventAttributes(attr) = e.attributes.as_ref().unwrap() {
|
|
47
|
-
attr.cause == GrpcMessageTooLarge as i32
|
|
48
|
-
&& attr.failure.as_ref().unwrap().message == "GRPC Message too large"
|
|
49
|
-
} else {
|
|
50
|
-
false
|
|
51
|
-
}
|
|
52
|
-
// Workflow terminated
|
|
53
|
-
||
|
|
54
|
-
e.event_type == EventType::WorkflowExecutionTerminated as i32
|
|
55
|
-
&& if let WorkflowExecutionTerminatedEventAttributes(attr) = e.attributes.as_ref().unwrap() {
|
|
56
|
-
attr.reason == "GrpcMessageTooLarge"
|
|
57
|
-
} else {
|
|
58
|
-
false
|
|
59
|
-
}
|
|
60
|
-
}),
|
|
70
|
+
events.iter().any(is_oversize_grpc_event),
|
|
61
71
|
"Expected workflow task failure or termination b/c grpc message too large: {events:?}",
|
|
62
72
|
);
|
|
63
73
|
}
|
|
74
|
+
|
|
75
|
+
pub(crate) fn is_oversize_grpc_event(
|
|
76
|
+
e: &temporalio_common::protos::temporal::api::history::v1::HistoryEvent,
|
|
77
|
+
) -> bool {
|
|
78
|
+
// Task failure
|
|
79
|
+
e.event_type == EventType::WorkflowTaskFailed as i32
|
|
80
|
+
&& if let WorkflowTaskFailedEventAttributes(attr) = e.attributes.as_ref().unwrap() {
|
|
81
|
+
attr.cause == GrpcMessageTooLarge as i32
|
|
82
|
+
&& attr.failure.as_ref().unwrap().message == "GRPC Message too large"
|
|
83
|
+
} else {
|
|
84
|
+
false
|
|
85
|
+
}
|
|
86
|
+
// Workflow terminated
|
|
87
|
+
||
|
|
88
|
+
e.event_type == EventType::WorkflowExecutionTerminated as i32
|
|
89
|
+
&& if let WorkflowExecutionTerminatedEventAttributes(attr) = e.attributes.as_ref().unwrap() {
|
|
90
|
+
attr.reason == "GrpcMessageTooLarge"
|
|
91
|
+
} else {
|
|
92
|
+
false
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
use crate::common::CoreWfStarter;
|
|
2
2
|
use std::time::Duration;
|
|
3
|
-
use temporalio_client::{
|
|
4
|
-
|
|
3
|
+
use temporalio_client::{Priority, UntypedWorkflow, WorkflowGetResultOptions};
|
|
4
|
+
use temporalio_common::protos::temporal::api::{common, history::v1::history_event::Attributes};
|
|
5
|
+
use temporalio_macros::{activities, workflow, workflow_methods};
|
|
6
|
+
use temporalio_sdk::{
|
|
7
|
+
ActivityOptions, ChildWorkflowOptions, WorkflowContext, WorkflowResult,
|
|
8
|
+
activities::{ActivityContext, ActivityError},
|
|
5
9
|
};
|
|
6
|
-
use temporalio_common::protos::{
|
|
7
|
-
coresdk::AsJsonPayloadExt,
|
|
8
|
-
temporal::api::{common, history::v1::history_event::Attributes},
|
|
9
|
-
};
|
|
10
|
-
use temporalio_sdk::{ActContext, ActivityOptions, ChildWorkflowOptions, WfContext};
|
|
11
10
|
|
|
12
11
|
pub(crate) async fn priority_values_sent_to_server() {
|
|
13
12
|
let mut starter = if let Some(wfs) =
|
|
@@ -17,95 +16,121 @@ pub(crate) async fn priority_values_sent_to_server() {
|
|
|
17
16
|
} else {
|
|
18
17
|
return;
|
|
19
18
|
};
|
|
20
|
-
starter.workflow_options.priority =
|
|
21
|
-
priority_key: 1,
|
|
22
|
-
fairness_key: "fair-wf".to_string(),
|
|
23
|
-
fairness_weight: 4.2,
|
|
24
|
-
}
|
|
19
|
+
starter.workflow_options.priority = Priority {
|
|
20
|
+
priority_key: Some(1),
|
|
21
|
+
fairness_key: Some("fair-wf".to_string()),
|
|
22
|
+
fairness_weight: Some(4.2),
|
|
23
|
+
};
|
|
25
24
|
let mut worker = starter.worker().await;
|
|
26
25
|
let child_type = "child-wf";
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
struct PriorityActivities;
|
|
28
|
+
#[activities]
|
|
29
|
+
impl PriorityActivities {
|
|
30
|
+
#[activity]
|
|
31
|
+
async fn echo(ctx: ActivityContext, echo_me: String) -> Result<String, ActivityError> {
|
|
32
|
+
assert_eq!(
|
|
33
|
+
ctx.info().priority,
|
|
34
|
+
Priority {
|
|
35
|
+
priority_key: Some(5),
|
|
36
|
+
fairness_key: Some("fair-act".to_string()),
|
|
37
|
+
fairness_weight: Some(1.1)
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
Ok(echo_me)
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
#[workflow]
|
|
45
|
+
#[derive(Default)]
|
|
46
|
+
struct ParentWf {
|
|
47
|
+
child_type: String,
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
#[workflow_methods]
|
|
51
|
+
impl ParentWf {
|
|
52
|
+
#[run]
|
|
53
|
+
async fn run(ctx: &mut WorkflowContext<Self>) -> WorkflowResult<()> {
|
|
54
|
+
let child = ctx.child_workflow(ChildWorkflowOptions {
|
|
55
|
+
workflow_id: format!("{}-child", ctx.task_queue()),
|
|
56
|
+
workflow_type: ctx.state(|wf| wf.child_type.clone()),
|
|
33
57
|
priority: Some(Priority {
|
|
34
|
-
priority_key: 4,
|
|
35
|
-
fairness_key: "fair-child".to_string(),
|
|
36
|
-
fairness_weight: 1.23,
|
|
58
|
+
priority_key: Some(4),
|
|
59
|
+
fairness_key: Some("fair-child".to_string()),
|
|
60
|
+
fairness_weight: Some(1.23),
|
|
37
61
|
}),
|
|
38
62
|
..Default::default()
|
|
39
|
-
}
|
|
40
|
-
..Default::default()
|
|
41
|
-
});
|
|
63
|
+
});
|
|
42
64
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
65
|
+
let started = child
|
|
66
|
+
.start()
|
|
67
|
+
.await
|
|
68
|
+
.into_started()
|
|
69
|
+
.expect("Child should start OK");
|
|
70
|
+
let activity = ctx.start_activity(
|
|
71
|
+
PriorityActivities::echo,
|
|
72
|
+
"hello".to_string(),
|
|
73
|
+
ActivityOptions {
|
|
74
|
+
start_to_close_timeout: Some(Duration::from_secs(5)),
|
|
75
|
+
priority: Some(Priority {
|
|
76
|
+
priority_key: Some(5),
|
|
77
|
+
fairness_key: Some("fair-act".to_string()),
|
|
78
|
+
fairness_weight: Some(1.1),
|
|
79
|
+
}),
|
|
80
|
+
do_not_eagerly_execute: true,
|
|
81
|
+
..Default::default()
|
|
82
|
+
},
|
|
83
|
+
);
|
|
84
|
+
started.result().await;
|
|
85
|
+
let _ = activity.await;
|
|
86
|
+
Ok(())
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
#[workflow]
|
|
91
|
+
#[derive(Default)]
|
|
92
|
+
struct ChildWf;
|
|
93
|
+
|
|
94
|
+
#[workflow_methods]
|
|
95
|
+
impl ChildWf {
|
|
96
|
+
#[run(name = "child-wf")]
|
|
97
|
+
async fn run(ctx: &mut WorkflowContext<Self>) -> WorkflowResult<()> {
|
|
98
|
+
assert_eq!(
|
|
99
|
+
ctx.workflow_initial_info().priority,
|
|
100
|
+
Some(common::v1::Priority {
|
|
101
|
+
priority_key: 4,
|
|
102
|
+
fairness_key: "fair-child".to_string(),
|
|
103
|
+
fairness_weight: 1.23
|
|
104
|
+
})
|
|
105
|
+
);
|
|
106
|
+
Ok(())
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
worker.register_activities(PriorityActivities);
|
|
111
|
+
worker.register_workflow_with_factory::<ParentWf, _>(move || ParentWf {
|
|
112
|
+
child_type: child_type.to_owned(),
|
|
86
113
|
});
|
|
114
|
+
worker.register_workflow::<ChildWf>();
|
|
87
115
|
|
|
88
|
-
|
|
89
|
-
.
|
|
90
|
-
.await
|
|
116
|
+
worker
|
|
117
|
+
.submit_workflow(ParentWf::run, (), starter.workflow_options.clone())
|
|
118
|
+
.await
|
|
119
|
+
.unwrap();
|
|
91
120
|
worker.run_until_done().await.unwrap();
|
|
92
121
|
|
|
93
122
|
let client = starter.get_client().await;
|
|
94
|
-
let handle = client.
|
|
95
|
-
|
|
96
|
-
.
|
|
123
|
+
let handle = client.get_workflow_handle::<UntypedWorkflow>(starter.get_task_queue());
|
|
124
|
+
handle
|
|
125
|
+
.get_result(WorkflowGetResultOptions::default())
|
|
97
126
|
.await
|
|
98
127
|
.unwrap();
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
let history = client
|
|
102
|
-
.get_workflow_execution_history(starter.get_task_queue().to_owned(), None, vec![])
|
|
128
|
+
let events = handle
|
|
129
|
+
.fetch_history(Default::default())
|
|
103
130
|
.await
|
|
104
131
|
.unwrap()
|
|
105
|
-
.
|
|
106
|
-
|
|
107
|
-
let workflow_init_event = history
|
|
108
|
-
.events
|
|
132
|
+
.into_events();
|
|
133
|
+
let workflow_init_event = events
|
|
109
134
|
.iter()
|
|
110
135
|
.find_map(|e| {
|
|
111
136
|
if let Attributes::WorkflowExecutionStartedEventAttributes(e) =
|
|
@@ -121,8 +146,7 @@ pub(crate) async fn priority_values_sent_to_server() {
|
|
|
121
146
|
workflow_init_event.priority.as_ref().unwrap().priority_key,
|
|
122
147
|
1
|
|
123
148
|
);
|
|
124
|
-
let child_init_event =
|
|
125
|
-
.events
|
|
149
|
+
let child_init_event = events
|
|
126
150
|
.iter()
|
|
127
151
|
.find_map(|e| {
|
|
128
152
|
if let Attributes::StartChildWorkflowExecutionInitiatedEventAttributes(e) =
|
|
@@ -135,8 +159,7 @@ pub(crate) async fn priority_values_sent_to_server() {
|
|
|
135
159
|
})
|
|
136
160
|
.unwrap();
|
|
137
161
|
assert_eq!(child_init_event.priority.as_ref().unwrap().priority_key, 4);
|
|
138
|
-
let activity_sched_event =
|
|
139
|
-
.events
|
|
162
|
+
let activity_sched_event = events
|
|
140
163
|
.iter()
|
|
141
164
|
.find_map(|e| {
|
|
142
165
|
if let Attributes::ActivityTaskScheduledEventAttributes(e) =
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
use temporalio_macros::{workflow, workflow_methods};
|
|
2
|
+
|
|
3
|
+
#[workflow]
|
|
4
|
+
pub struct BadWorkflow;
|
|
5
|
+
|
|
6
|
+
#[workflow_methods]
|
|
7
|
+
impl BadWorkflow {
|
|
8
|
+
#[run]
|
|
9
|
+
pub async fn run(_ctx: &mut WorkflowContext<Self>) -> WorkflowResult<()> {
|
|
10
|
+
Ok(())
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// This should fail - queries must not be async
|
|
14
|
+
#[query]
|
|
15
|
+
pub async fn get_value(&self, _ctx: &WorkflowContextView) -> u32 {
|
|
16
|
+
42
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
impl Default for BadWorkflow {
|
|
21
|
+
fn default() -> Self {
|
|
22
|
+
Self
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
fn main() {}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
use temporalio_macros::{workflow, workflow_methods};
|
|
2
|
+
use temporalio_sdk::{SyncWorkflowContext, WorkflowContext, WorkflowContextView, WorkflowResult};
|
|
3
|
+
|
|
4
|
+
#[workflow]
|
|
5
|
+
pub struct MyWorkflow {
|
|
6
|
+
counter: u32,
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
#[workflow_methods]
|
|
10
|
+
impl MyWorkflow {
|
|
11
|
+
#[init]
|
|
12
|
+
pub fn new(_ctx: &WorkflowContextView, _input: String) -> Self {
|
|
13
|
+
Self { counter: 0 }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Async run uses &self
|
|
17
|
+
#[run]
|
|
18
|
+
pub async fn run(_ctx: &mut WorkflowContext<Self>) -> WorkflowResult<String> {
|
|
19
|
+
Ok("hi".to_owned())
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Sync signal uses &mut self
|
|
23
|
+
#[signal(name = "increment")]
|
|
24
|
+
pub fn increment_counter(&mut self, _ctx: &mut SyncWorkflowContext<Self>, amount: u32) {
|
|
25
|
+
self.counter += amount;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
#[signal]
|
|
29
|
+
pub async fn async_signal(_ctx: &mut WorkflowContext<Self>) {}
|
|
30
|
+
|
|
31
|
+
// Query uses &self with read-only context
|
|
32
|
+
#[query]
|
|
33
|
+
pub fn get_counter(&self, _ctx: &WorkflowContextView) -> u32 {
|
|
34
|
+
self.counter
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
#[update(name = "double")]
|
|
38
|
+
pub fn double_counter(&mut self, _ctx: &mut SyncWorkflowContext<Self>) -> u32 {
|
|
39
|
+
self.counter *= 2;
|
|
40
|
+
self.counter
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
#[update]
|
|
44
|
+
pub async fn async_update(_ctx: &mut WorkflowContext<Self>, val: i32) -> i32 {
|
|
45
|
+
val * 2
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
fn main() {}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
use temporalio_macros::{workflow, workflow_methods};
|
|
2
|
+
use temporalio_sdk::{WorkflowContext, WorkflowResult};
|
|
3
|
+
|
|
4
|
+
#[workflow]
|
|
5
|
+
pub struct MinimalWorkflow;
|
|
6
|
+
|
|
7
|
+
#[workflow_methods]
|
|
8
|
+
impl MinimalWorkflow {
|
|
9
|
+
#[run]
|
|
10
|
+
pub async fn run(_ctx: &mut WorkflowContext<Self>) -> WorkflowResult<()> {
|
|
11
|
+
Ok(())
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
impl Default for MinimalWorkflow {
|
|
16
|
+
fn default() -> Self {
|
|
17
|
+
Self
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
fn main() {}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
use temporalio_macros::{workflow, workflow_methods};
|
|
2
|
+
|
|
3
|
+
#[workflow]
|
|
4
|
+
pub struct BadWorkflow;
|
|
5
|
+
|
|
6
|
+
#[workflow_methods]
|
|
7
|
+
impl BadWorkflow {
|
|
8
|
+
#[run]
|
|
9
|
+
pub async fn run(_ctx: &mut WorkflowContext<Self>) -> WorkflowResult<()> {
|
|
10
|
+
Ok(())
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// This should fail - queries must use &self, not &mut self
|
|
14
|
+
#[query]
|
|
15
|
+
pub fn get_value(&mut self, _ctx: &WorkflowContextView) -> u32 {
|
|
16
|
+
42
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
impl Default for BadWorkflow {
|
|
21
|
+
fn default() -> Self {
|
|
22
|
+
Self
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
fn main() {}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
use temporalio_macros::{workflow, workflow_methods};
|
|
2
|
+
|
|
3
|
+
#[workflow]
|
|
4
|
+
pub struct BadWorkflow;
|
|
5
|
+
|
|
6
|
+
#[workflow_methods]
|
|
7
|
+
impl BadWorkflow {
|
|
8
|
+
// This should fail - run must be async
|
|
9
|
+
#[run]
|
|
10
|
+
pub fn run(&self, _ctx: &mut WorkflowContext<Self>) -> WorkflowResult<()> {
|
|
11
|
+
Ok(())
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
impl Default for BadWorkflow {
|
|
16
|
+
fn default() -> Self {
|
|
17
|
+
Self
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
fn main() {}
|
|
@@ -7,6 +7,9 @@ license-file = { workspace = true }
|
|
|
7
7
|
description = "C bridge for Temporal Core SDK"
|
|
8
8
|
homepage = "https://temporal.io/"
|
|
9
9
|
repository = "https://github.com/temporalio/sdk-core"
|
|
10
|
+
keywords = ["temporal", "workflow"]
|
|
11
|
+
categories = ["development-tools"]
|
|
12
|
+
publish = false
|
|
10
13
|
|
|
11
14
|
[lib]
|
|
12
15
|
name = "temporalio_sdk_core_c_bridge"
|
|
@@ -38,14 +41,17 @@ xz2 = { version = "0.1" }
|
|
|
38
41
|
|
|
39
42
|
[dependencies.temporalio-client]
|
|
40
43
|
path = "../client"
|
|
44
|
+
version = "0.1"
|
|
41
45
|
|
|
42
46
|
[dependencies.temporalio-sdk-core]
|
|
43
47
|
path = "../sdk-core"
|
|
48
|
+
version = "0.1"
|
|
44
49
|
features = ["ephemeral-server"]
|
|
45
50
|
|
|
46
51
|
[dependencies.temporalio-common]
|
|
47
52
|
path = "../common"
|
|
48
|
-
|
|
53
|
+
version = "0.1"
|
|
54
|
+
features = ["core-based-sdk"]
|
|
49
55
|
|
|
50
56
|
[dev-dependencies]
|
|
51
57
|
base64 = "0.21.0"
|
|
@@ -56,8 +56,6 @@ typedef enum TemporalCoreSlotKindType {
|
|
|
56
56
|
|
|
57
57
|
typedef struct TemporalCoreCancellationToken TemporalCoreCancellationToken;
|
|
58
58
|
|
|
59
|
-
typedef struct TemporalCoreClient TemporalCoreClient;
|
|
60
|
-
|
|
61
59
|
/**
|
|
62
60
|
* Representation of gRPC request for the callback.
|
|
63
61
|
*
|
|
@@ -67,6 +65,8 @@ typedef struct TemporalCoreClient TemporalCoreClient;
|
|
|
67
65
|
*/
|
|
68
66
|
typedef struct TemporalCoreClientGrpcOverrideRequest TemporalCoreClientGrpcOverrideRequest;
|
|
69
67
|
|
|
68
|
+
typedef struct TemporalCoreConnection TemporalCoreConnection;
|
|
69
|
+
|
|
70
70
|
typedef struct TemporalCoreEphemeralServer TemporalCoreEphemeralServer;
|
|
71
71
|
|
|
72
72
|
typedef struct TemporalCoreForwardedLog TemporalCoreForwardedLog;
|
|
@@ -144,7 +144,7 @@ typedef struct TemporalCoreClientHttpConnectProxyOptions {
|
|
|
144
144
|
typedef void (*TemporalCoreClientGrpcOverrideCallback)(struct TemporalCoreClientGrpcOverrideRequest *request,
|
|
145
145
|
void *user_data);
|
|
146
146
|
|
|
147
|
-
typedef struct
|
|
147
|
+
typedef struct TemporalCoreConnectionOptions {
|
|
148
148
|
struct TemporalCoreByteArrayRef target_url;
|
|
149
149
|
struct TemporalCoreByteArrayRef client_name;
|
|
150
150
|
struct TemporalCoreByteArrayRef client_version;
|
|
@@ -171,7 +171,7 @@ typedef struct TemporalCoreClientOptions {
|
|
|
171
171
|
* Optional user data passed to each callback call.
|
|
172
172
|
*/
|
|
173
173
|
void *grpc_override_callback_user_data;
|
|
174
|
-
}
|
|
174
|
+
} TemporalCoreConnectionOptions;
|
|
175
175
|
|
|
176
176
|
typedef struct TemporalCoreByteArray {
|
|
177
177
|
const uint8_t *data;
|
|
@@ -190,7 +190,7 @@ typedef struct TemporalCoreByteArray {
|
|
|
190
190
|
* If success or fail are not null, they must be manually freed when done.
|
|
191
191
|
*/
|
|
192
192
|
typedef void (*TemporalCoreClientConnectCallback)(void *user_data,
|
|
193
|
-
struct
|
|
193
|
+
struct TemporalCoreConnection *success,
|
|
194
194
|
const struct TemporalCoreByteArray *fail);
|
|
195
195
|
|
|
196
196
|
/**
|
|
@@ -692,7 +692,7 @@ typedef struct TemporalCoreCustomSlotSupplierCallbacks {
|
|
|
692
692
|
*/
|
|
693
693
|
TemporalCoreCustomSlotSupplierTryReserveCallback try_reserve;
|
|
694
694
|
/**
|
|
695
|
-
* Called after successful reservation to mark slot as used. See [`SlotSupplier`](
|
|
695
|
+
* Called after successful reservation to mark slot as used. See [`SlotSupplier`](temporalio_sdk_core::SlotSupplier)
|
|
696
696
|
* trait for details.
|
|
697
697
|
*/
|
|
698
698
|
TemporalCoreCustomSlotSupplierMarkUsedCallback mark_used;
|
|
@@ -834,19 +834,19 @@ void temporal_core_cancellation_token_free(struct TemporalCoreCancellationToken
|
|
|
834
834
|
* callback.
|
|
835
835
|
*/
|
|
836
836
|
void temporal_core_client_connect(struct TemporalCoreRuntime *runtime,
|
|
837
|
-
const struct
|
|
837
|
+
const struct TemporalCoreConnectionOptions *options,
|
|
838
838
|
void *user_data,
|
|
839
839
|
TemporalCoreClientConnectCallback callback);
|
|
840
840
|
|
|
841
|
-
void temporal_core_client_free(struct
|
|
841
|
+
void temporal_core_client_free(struct TemporalCoreConnection *client);
|
|
842
842
|
|
|
843
|
-
void temporal_core_client_update_metadata(struct
|
|
843
|
+
void temporal_core_client_update_metadata(struct TemporalCoreConnection *client,
|
|
844
844
|
TemporalCoreMetadataRef metadata);
|
|
845
845
|
|
|
846
|
-
void temporal_core_client_update_binary_metadata(struct
|
|
846
|
+
void temporal_core_client_update_binary_metadata(struct TemporalCoreConnection *client,
|
|
847
847
|
TemporalCoreMetadataRef metadata);
|
|
848
848
|
|
|
849
|
-
void temporal_core_client_update_api_key(struct
|
|
849
|
+
void temporal_core_client_update_api_key(struct TemporalCoreConnection *client,
|
|
850
850
|
struct TemporalCoreByteArrayRef api_key);
|
|
851
851
|
|
|
852
852
|
/**
|
|
@@ -889,7 +889,7 @@ void temporal_core_client_grpc_override_request_respond(struct TemporalCoreClien
|
|
|
889
889
|
/**
|
|
890
890
|
* Client, options, and user data must live through callback.
|
|
891
891
|
*/
|
|
892
|
-
void temporal_core_client_rpc_call(struct
|
|
892
|
+
void temporal_core_client_rpc_call(struct TemporalCoreConnection *client,
|
|
893
893
|
const struct TemporalCoreRpcCallOptions *options,
|
|
894
894
|
void *user_data,
|
|
895
895
|
TemporalCoreClientRpcCallCallback callback);
|
|
@@ -996,7 +996,7 @@ void temporal_core_ephemeral_server_shutdown(struct TemporalCoreEphemeralServer
|
|
|
996
996
|
void *user_data,
|
|
997
997
|
TemporalCoreEphemeralServerShutdownCallback callback);
|
|
998
998
|
|
|
999
|
-
struct TemporalCoreWorkerOrFail temporal_core_worker_new(struct
|
|
999
|
+
struct TemporalCoreWorkerOrFail temporal_core_worker_new(struct TemporalCoreConnection *connection,
|
|
1000
1000
|
const struct TemporalCoreWorkerOptions *options);
|
|
1001
1001
|
|
|
1002
1002
|
void temporal_core_worker_free(struct TemporalCoreWorker *worker);
|
|
@@ -1006,7 +1006,7 @@ void temporal_core_worker_validate(struct TemporalCoreWorker *worker,
|
|
|
1006
1006
|
TemporalCoreWorkerCallback callback);
|
|
1007
1007
|
|
|
1008
1008
|
const struct TemporalCoreByteArray *temporal_core_worker_replace_client(struct TemporalCoreWorker *worker,
|
|
1009
|
-
struct
|
|
1009
|
+
struct TemporalCoreConnection *new_connection);
|
|
1010
1010
|
|
|
1011
1011
|
void temporal_core_worker_poll_workflow_activation(struct TemporalCoreWorker *worker,
|
|
1012
1012
|
void *user_data,
|