@temporalio/core-bridge 1.12.0 → 1.12.2
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 +64 -119
- package/Cargo.toml +1 -1
- package/index.js +3 -2
- package/package.json +3 -3
- 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 +1 -2
- package/sdk-core/.github/workflows/per-pr.yml +2 -0
- package/sdk-core/AGENTS.md +7 -0
- package/sdk-core/Cargo.toml +9 -5
- package/sdk-core/README.md +6 -5
- package/sdk-core/client/Cargo.toml +3 -2
- package/sdk-core/client/src/lib.rs +17 -8
- package/sdk-core/client/src/metrics.rs +57 -23
- package/sdk-core/client/src/raw.rs +33 -15
- package/sdk-core/core/Cargo.toml +11 -9
- package/sdk-core/core/benches/workflow_replay.rs +114 -15
- package/sdk-core/core/src/core_tests/activity_tasks.rs +18 -18
- package/sdk-core/core/src/core_tests/child_workflows.rs +4 -4
- package/sdk-core/core/src/core_tests/determinism.rs +6 -6
- package/sdk-core/core/src/core_tests/local_activities.rs +20 -20
- package/sdk-core/core/src/core_tests/mod.rs +40 -5
- package/sdk-core/core/src/core_tests/queries.rs +25 -16
- package/sdk-core/core/src/core_tests/replay_flag.rs +3 -3
- package/sdk-core/core/src/core_tests/updates.rs +3 -3
- package/sdk-core/core/src/core_tests/workers.rs +9 -7
- package/sdk-core/core/src/core_tests/workflow_tasks.rs +40 -42
- package/sdk-core/core/src/ephemeral_server/mod.rs +1 -19
- package/sdk-core/core/src/lib.rs +10 -1
- package/sdk-core/core/src/pollers/poll_buffer.rs +2 -2
- package/sdk-core/core/src/replay/mod.rs +3 -3
- package/sdk-core/core/src/telemetry/metrics.rs +306 -152
- package/sdk-core/core/src/telemetry/mod.rs +11 -4
- package/sdk-core/core/src/telemetry/otel.rs +134 -131
- package/sdk-core/core/src/telemetry/prometheus_meter.rs +885 -0
- package/sdk-core/core/src/telemetry/prometheus_server.rs +48 -28
- package/sdk-core/core/src/test_help/mod.rs +27 -12
- package/sdk-core/core/src/worker/activities/activity_heartbeat_manager.rs +7 -7
- package/sdk-core/core/src/worker/activities.rs +4 -4
- package/sdk-core/core/src/worker/client/mocks.rs +10 -3
- package/sdk-core/core/src/worker/client.rs +68 -5
- package/sdk-core/core/src/worker/heartbeat.rs +229 -0
- package/sdk-core/core/src/worker/mod.rs +35 -14
- package/sdk-core/core/src/worker/tuner/resource_based.rs +4 -4
- package/sdk-core/core/src/worker/workflow/history_update.rs +71 -19
- package/sdk-core/core/src/worker/workflow/machines/cancel_external_state_machine.rs +1 -2
- package/sdk-core/core/src/worker/workflow/machines/child_workflow_state_machine.rs +1 -1
- package/sdk-core/core/src/worker/workflow/machines/nexus_operation_state_machine.rs +31 -48
- package/sdk-core/core/src/worker/workflow/machines/signal_external_state_machine.rs +1 -2
- package/sdk-core/core/src/worker/workflow/machines/upsert_search_attributes_state_machine.rs +3 -3
- package/sdk-core/core/src/worker/workflow/machines/workflow_machines.rs +4 -1
- package/sdk-core/core/src/worker/workflow/managed_run.rs +1 -1
- package/sdk-core/core/src/worker/workflow/mod.rs +15 -15
- package/sdk-core/core-api/Cargo.toml +2 -2
- package/sdk-core/core-api/src/envconfig.rs +204 -99
- package/sdk-core/core-api/src/lib.rs +9 -0
- package/sdk-core/core-api/src/telemetry/metrics.rs +548 -100
- package/sdk-core/core-api/src/worker.rs +11 -5
- package/sdk-core/core-c-bridge/Cargo.toml +49 -0
- package/sdk-core/core-c-bridge/build.rs +26 -0
- package/sdk-core/core-c-bridge/include/temporal-sdk-core-c-bridge.h +817 -0
- package/sdk-core/core-c-bridge/src/client.rs +679 -0
- package/sdk-core/core-c-bridge/src/lib.rs +245 -0
- package/sdk-core/core-c-bridge/src/metric.rs +682 -0
- package/sdk-core/core-c-bridge/src/random.rs +61 -0
- package/sdk-core/core-c-bridge/src/runtime.rs +445 -0
- package/sdk-core/core-c-bridge/src/testing.rs +282 -0
- package/sdk-core/core-c-bridge/src/tests/context.rs +644 -0
- package/sdk-core/core-c-bridge/src/tests/mod.rs +178 -0
- package/sdk-core/core-c-bridge/src/tests/utils.rs +108 -0
- package/sdk-core/core-c-bridge/src/worker.rs +1069 -0
- package/sdk-core/etc/deps.svg +64 -64
- package/sdk-core/sdk/src/activity_context.rs +6 -4
- package/sdk-core/sdk/src/lib.rs +49 -27
- package/sdk-core/sdk/src/workflow_future.rs +18 -25
- package/sdk-core/sdk-core-protos/protos/api_upstream/README.md +4 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/buf.yaml +0 -2
- package/sdk-core/sdk-core-protos/protos/api_upstream/openapi/openapiv2.json +630 -83
- package/sdk-core/sdk-core-protos/protos/api_upstream/openapi/openapiv3.yaml +632 -78
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/batch/v1/message.proto +4 -4
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/command/v1/message.proto +6 -4
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/common/v1/message.proto +2 -2
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/deployment/v1/message.proto +32 -2
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/common.proto +10 -1
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/deployment.proto +26 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/failed_cause.proto +2 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/reset.proto +4 -4
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/failure/v1/message.proto +2 -2
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/history/v1/message.proto +47 -31
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/nexus/v1/message.proto +4 -4
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/schedule/v1/message.proto +7 -1
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/worker/v1/message.proto +134 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflow/v1/message.proto +14 -11
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +148 -37
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +21 -0
- package/sdk-core/sdk-core-protos/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +4 -4
- package/sdk-core/sdk-core-protos/src/history_builder.rs +9 -5
- package/sdk-core/sdk-core-protos/src/lib.rs +96 -6
- package/sdk-core/test-utils/src/lib.rs +11 -3
- package/sdk-core/tests/cloud_tests.rs +3 -3
- package/sdk-core/tests/heavy_tests.rs +11 -3
- package/sdk-core/tests/integ_tests/client_tests.rs +12 -13
- package/sdk-core/tests/integ_tests/ephemeral_server_tests.rs +1 -1
- package/sdk-core/tests/integ_tests/metrics_tests.rs +188 -83
- package/sdk-core/tests/integ_tests/polling_tests.rs +1 -1
- package/sdk-core/tests/integ_tests/queries_tests.rs +56 -40
- package/sdk-core/tests/integ_tests/update_tests.rs +2 -7
- package/sdk-core/tests/integ_tests/worker_tests.rs +3 -4
- package/sdk-core/tests/integ_tests/worker_versioning_tests.rs +3 -7
- package/sdk-core/tests/integ_tests/workflow_tests/local_activities.rs +3 -5
- package/sdk-core/tests/integ_tests/workflow_tests/nexus.rs +24 -17
- package/src/client.rs +6 -0
- package/src/metrics.rs +6 -6
|
@@ -161,6 +161,12 @@ pub struct WorkerConfig {
|
|
|
161
161
|
|
|
162
162
|
/// A versioning strategy for this worker.
|
|
163
163
|
pub versioning_strategy: WorkerVersioningStrategy,
|
|
164
|
+
|
|
165
|
+
/// The interval within which the worker will send a heartbeat.
|
|
166
|
+
/// The timer is reset on each existing RPC call that also happens to send this data, like
|
|
167
|
+
/// `PollWorkflowTaskQueueRequest`.
|
|
168
|
+
#[builder(default = "Duration::from_secs(60)")]
|
|
169
|
+
pub heartbeat_interval: Duration,
|
|
164
170
|
}
|
|
165
171
|
|
|
166
172
|
impl WorkerConfig {
|
|
@@ -454,25 +460,25 @@ pub enum SlotInfo<'a> {
|
|
|
454
460
|
}
|
|
455
461
|
|
|
456
462
|
pub trait SlotInfoTrait: prost::Message {
|
|
457
|
-
fn downcast(&self) -> SlotInfo
|
|
463
|
+
fn downcast(&self) -> SlotInfo<'_>;
|
|
458
464
|
}
|
|
459
465
|
impl SlotInfoTrait for WorkflowSlotInfo {
|
|
460
|
-
fn downcast(&self) -> SlotInfo {
|
|
466
|
+
fn downcast(&self) -> SlotInfo<'_> {
|
|
461
467
|
SlotInfo::Workflow(self)
|
|
462
468
|
}
|
|
463
469
|
}
|
|
464
470
|
impl SlotInfoTrait for ActivitySlotInfo {
|
|
465
|
-
fn downcast(&self) -> SlotInfo {
|
|
471
|
+
fn downcast(&self) -> SlotInfo<'_> {
|
|
466
472
|
SlotInfo::Activity(self)
|
|
467
473
|
}
|
|
468
474
|
}
|
|
469
475
|
impl SlotInfoTrait for LocalActivitySlotInfo {
|
|
470
|
-
fn downcast(&self) -> SlotInfo {
|
|
476
|
+
fn downcast(&self) -> SlotInfo<'_> {
|
|
471
477
|
SlotInfo::LocalActivity(self)
|
|
472
478
|
}
|
|
473
479
|
}
|
|
474
480
|
impl SlotInfoTrait for NexusSlotInfo {
|
|
475
|
-
fn downcast(&self) -> SlotInfo {
|
|
481
|
+
fn downcast(&self) -> SlotInfo<'_> {
|
|
476
482
|
SlotInfo::Nexus(self)
|
|
477
483
|
}
|
|
478
484
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "temporal-sdk-core-c-bridge"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
edition = "2024"
|
|
5
|
+
|
|
6
|
+
[lib]
|
|
7
|
+
name = "temporal_sdk_core_c_bridge"
|
|
8
|
+
crate-type = ["cdylib"]
|
|
9
|
+
|
|
10
|
+
[dependencies]
|
|
11
|
+
anyhow = "1.0"
|
|
12
|
+
async-trait = "0.1"
|
|
13
|
+
libc = "0.2"
|
|
14
|
+
prost = { workspace = true }
|
|
15
|
+
# We rely on Cargo semver rules not updating a 0.x to 0.y. Per the rand
|
|
16
|
+
# documentation, before 1.0, minor 0.x updates _can_ break portability which can
|
|
17
|
+
# cause non-determinism.
|
|
18
|
+
rand = "0.8.5"
|
|
19
|
+
rand_pcg = "0.3.1"
|
|
20
|
+
serde_json = "1.0"
|
|
21
|
+
tokio = "1.26"
|
|
22
|
+
tokio-stream = "0.1"
|
|
23
|
+
tokio-util = "0.7"
|
|
24
|
+
tonic = { workspace = true }
|
|
25
|
+
tracing = "0.1"
|
|
26
|
+
url = "2.2"
|
|
27
|
+
|
|
28
|
+
[dependencies.temporal-client]
|
|
29
|
+
path = "../client"
|
|
30
|
+
|
|
31
|
+
[dependencies.temporal-sdk-core]
|
|
32
|
+
path = "../core"
|
|
33
|
+
features = ["ephemeral-server"]
|
|
34
|
+
|
|
35
|
+
[dependencies.temporal-sdk-core-api]
|
|
36
|
+
path = "../core-api"
|
|
37
|
+
|
|
38
|
+
[dependencies.temporal-sdk-core-protos]
|
|
39
|
+
path = "../sdk-core-protos"
|
|
40
|
+
|
|
41
|
+
[dev-dependencies]
|
|
42
|
+
futures-util = "0.3"
|
|
43
|
+
thiserror = { workspace = true }
|
|
44
|
+
|
|
45
|
+
[dev-dependencies.temporal-sdk-core-test-utils]
|
|
46
|
+
path = "../test-utils"
|
|
47
|
+
|
|
48
|
+
[build-dependencies]
|
|
49
|
+
cbindgen = { version = "0.29", default-features = false }
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
extern crate cbindgen;
|
|
2
|
+
|
|
3
|
+
use std::env;
|
|
4
|
+
|
|
5
|
+
fn main() {
|
|
6
|
+
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
|
|
7
|
+
|
|
8
|
+
let changed = cbindgen::Builder::new()
|
|
9
|
+
.with_cpp_compat(true)
|
|
10
|
+
.with_crate(crate_dir)
|
|
11
|
+
.with_pragma_once(true)
|
|
12
|
+
.with_language(cbindgen::Language::C)
|
|
13
|
+
.with_item_prefix("TemporalCore")
|
|
14
|
+
.generate()
|
|
15
|
+
.expect("Unable to generate bindings")
|
|
16
|
+
.write_to_file("include/temporal-sdk-core-c-bridge.h");
|
|
17
|
+
|
|
18
|
+
// If this changed and an env var disallows change, error
|
|
19
|
+
if let Ok(env_val) = env::var("TEMPORAL_SDK_BRIDGE_DISABLE_HEADER_CHANGE")
|
|
20
|
+
&& changed
|
|
21
|
+
&& env_val == "true"
|
|
22
|
+
{
|
|
23
|
+
println!("cargo:warning=bridge's header file changed unexpectedly from what's on disk");
|
|
24
|
+
std::process::exit(1);
|
|
25
|
+
}
|
|
26
|
+
}
|