@temporalio/core-bridge 1.14.2-canary-release-testing.0 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.lock +794 -650
- package/bridge-macros/src/derive_tryintojs.rs +40 -0
- package/lib/native.d.ts +24 -3
- package/package.json +4 -4
- package/releases/aarch64-apple-darwin/index.node +0 -0
- package/releases/aarch64-unknown-linux-gnu/index.node +0 -0
- package/releases/x86_64-apple-darwin/index.node +0 -0
- package/releases/x86_64-pc-windows-msvc/index.node +0 -0
- package/releases/x86_64-unknown-linux-gnu/index.node +0 -0
- package/sdk-core/.github/workflows/per-pr.yml +6 -6
- package/sdk-core/AGENTS.md +42 -31
- package/sdk-core/Cargo.toml +4 -1
- package/sdk-core/README.md +19 -13
- package/sdk-core/crates/client/Cargo.toml +4 -0
- package/sdk-core/crates/client/README.md +139 -0
- package/sdk-core/crates/client/src/async_activity_handle.rs +297 -0
- package/sdk-core/crates/client/src/callback_based.rs +7 -0
- package/sdk-core/crates/client/src/errors.rs +294 -0
- package/sdk-core/crates/client/src/{raw.rs → grpc.rs} +370 -159
- package/sdk-core/crates/client/src/lib.rs +920 -1326
- package/sdk-core/crates/client/src/metrics.rs +24 -33
- package/sdk-core/crates/client/src/options_structs.rs +457 -0
- package/sdk-core/crates/client/src/replaceable.rs +5 -4
- package/sdk-core/crates/client/src/request_extensions.rs +8 -9
- package/sdk-core/crates/client/src/retry.rs +99 -54
- package/sdk-core/crates/client/src/{worker/mod.rs → worker.rs} +104 -29
- package/sdk-core/crates/client/src/workflow_handle.rs +826 -0
- package/sdk-core/crates/common/Cargo.toml +62 -3
- package/sdk-core/crates/common/build.rs +742 -12
- package/sdk-core/crates/common/protos/api_upstream/.github/workflows/ci.yml +2 -0
- package/sdk-core/crates/common/protos/api_upstream/.github/workflows/create-release.yml +0 -5
- package/sdk-core/crates/common/protos/api_upstream/Makefile +2 -1
- package/sdk-core/crates/common/protos/api_upstream/README.md +8 -0
- package/sdk-core/crates/common/protos/api_upstream/cmd/check-path-conflicts/main.go +137 -0
- package/sdk-core/crates/common/protos/api_upstream/openapi/openapiv2.json +3329 -2647
- package/sdk-core/crates/common/protos/api_upstream/openapi/openapiv3.yaml +2734 -708
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/activity/v1/message.proto +155 -3
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/command/v1/message.proto +26 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/common/v1/message.proto +8 -1
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/deployment/v1/message.proto +27 -1
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/enums/v1/activity.proto +81 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/enums/v1/event_type.proto +4 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/enums/v1/failed_cause.proto +4 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/enums/v1/task_queue.proto +15 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/enums/v1/workflow.proto +63 -15
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/errordetails/v1/message.proto +8 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/failure/v1/message.proto +1 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/history/v1/message.proto +111 -17
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/namespace/v1/message.proto +21 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/nexus/v1/message.proto +20 -1
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/operatorservice/v1/request_response.proto +4 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/schedule/v1/message.proto +2 -2
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/taskqueue/v1/message.proto +2 -0
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/worker/v1/message.proto +4 -7
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/workflow/v1/message.proto +80 -22
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +347 -23
- package/sdk-core/crates/common/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +242 -43
- package/sdk-core/crates/common/protos/local/temporal/sdk/core/core_interface.proto +15 -0
- package/sdk-core/crates/common/protos/local/temporal/sdk/core/nexus/nexus.proto +9 -2
- package/sdk-core/crates/common/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +8 -0
- package/sdk-core/crates/common/protos/local/temporal/sdk/core/workflow_commands/workflow_commands.proto +22 -5
- package/sdk-core/crates/common/src/activity_definition.rs +20 -0
- package/sdk-core/crates/common/src/data_converters.rs +770 -0
- package/sdk-core/crates/common/src/envconfig.rs +5 -0
- package/sdk-core/crates/common/src/lib.rs +15 -211
- package/sdk-core/crates/common/src/payload_visitor.rs +648 -0
- package/sdk-core/crates/common/src/priority.rs +110 -0
- package/sdk-core/crates/common/src/protos/canned_histories.rs +19 -0
- package/sdk-core/crates/common/src/protos/history_builder.rs +45 -0
- package/sdk-core/crates/common/src/protos/history_info.rs +2 -0
- package/sdk-core/crates/common/src/protos/mod.rs +134 -27
- package/sdk-core/crates/common/src/protos/task_token.rs +3 -3
- package/sdk-core/crates/common/src/protos/utilities.rs +11 -0
- package/sdk-core/crates/{sdk-core → common}/src/telemetry/log_export.rs +11 -16
- package/sdk-core/crates/common/src/telemetry/metrics/core.rs +125 -0
- package/sdk-core/crates/common/src/telemetry/metrics.rs +272 -225
- package/sdk-core/crates/{sdk-core → common}/src/telemetry/otel.rs +8 -13
- package/sdk-core/crates/{sdk-core → common}/src/telemetry/prometheus_meter.rs +49 -50
- package/sdk-core/crates/{sdk-core → common}/src/telemetry/prometheus_server.rs +2 -3
- package/sdk-core/crates/common/src/telemetry.rs +278 -19
- package/sdk-core/crates/common/src/worker.rs +68 -636
- package/sdk-core/crates/common/src/workflow_definition.rs +60 -0
- package/sdk-core/crates/macros/Cargo.toml +5 -1
- package/sdk-core/crates/macros/src/activities_definitions.rs +585 -0
- package/sdk-core/crates/macros/src/fsm_impl.rs +507 -0
- package/sdk-core/crates/macros/src/lib.rs +138 -512
- package/sdk-core/crates/macros/src/macro_utils.rs +106 -0
- package/sdk-core/crates/macros/src/workflow_definitions.rs +1224 -0
- package/sdk-core/crates/sdk/Cargo.toml +19 -6
- package/sdk-core/crates/sdk/README.md +415 -0
- package/sdk-core/crates/sdk/src/activities.rs +417 -0
- package/sdk-core/crates/sdk/src/interceptors.rs +1 -1
- package/sdk-core/crates/sdk/src/lib.rs +759 -442
- package/sdk-core/crates/sdk/src/workflow_context/options.rs +64 -35
- package/sdk-core/crates/sdk/src/workflow_context.rs +1033 -289
- package/sdk-core/crates/sdk/src/workflow_future.rs +277 -213
- package/sdk-core/crates/sdk/src/workflows.rs +711 -0
- package/sdk-core/crates/sdk-core/Cargo.toml +59 -65
- package/sdk-core/crates/sdk-core/benches/workflow_replay_bench.rs +45 -54
- package/sdk-core/crates/sdk-core/machine_coverage/ActivityMachine_Coverage.puml +1 -1
- package/sdk-core/crates/sdk-core/src/abstractions.rs +6 -10
- package/sdk-core/crates/sdk-core/src/core_tests/activity_tasks.rs +6 -5
- package/sdk-core/crates/sdk-core/src/core_tests/mod.rs +22 -21
- package/sdk-core/crates/sdk-core/src/core_tests/queries.rs +21 -25
- package/sdk-core/crates/sdk-core/src/core_tests/replay_flag.rs +7 -10
- package/sdk-core/crates/sdk-core/src/core_tests/updates.rs +14 -17
- package/sdk-core/crates/sdk-core/src/core_tests/workers.rs +647 -27
- package/sdk-core/crates/sdk-core/src/core_tests/workflow_tasks.rs +46 -41
- package/sdk-core/crates/sdk-core/src/ephemeral_server/mod.rs +13 -16
- package/sdk-core/crates/sdk-core/src/histfetch.rs +20 -10
- package/sdk-core/crates/sdk-core/src/lib.rs +60 -123
- package/sdk-core/crates/sdk-core/src/pollers/mod.rs +4 -9
- package/sdk-core/crates/sdk-core/src/pollers/poll_buffer.rs +411 -32
- package/sdk-core/crates/sdk-core/src/protosext/mod.rs +2 -2
- package/sdk-core/crates/sdk-core/src/replay/mod.rs +14 -5
- package/sdk-core/crates/sdk-core/src/telemetry/metrics.rs +183 -198
- package/sdk-core/crates/sdk-core/src/telemetry/mod.rs +3 -281
- package/sdk-core/crates/sdk-core/src/test_help/integ_helpers.rs +35 -16
- package/sdk-core/crates/sdk-core/src/test_help/unit_helpers.rs +3 -6
- package/sdk-core/crates/sdk-core/src/worker/activities/activity_heartbeat_manager.rs +1 -0
- package/sdk-core/crates/sdk-core/src/worker/activities/local_activities.rs +11 -14
- package/sdk-core/crates/sdk-core/src/worker/activities.rs +16 -19
- package/sdk-core/crates/sdk-core/src/worker/client/mocks.rs +11 -5
- package/sdk-core/crates/sdk-core/src/worker/client.rs +104 -86
- package/sdk-core/crates/sdk-core/src/worker/heartbeat.rs +10 -14
- package/sdk-core/crates/sdk-core/src/worker/mod.rs +1175 -241
- package/sdk-core/crates/sdk-core/src/worker/nexus.rs +150 -23
- package/sdk-core/crates/sdk-core/src/worker/slot_provider.rs +2 -2
- package/sdk-core/crates/sdk-core/src/worker/tuner/fixed_size.rs +2 -2
- package/sdk-core/crates/sdk-core/src/worker/tuner/resource_based.rs +25 -27
- package/sdk-core/crates/sdk-core/src/worker/tuner.rs +64 -44
- package/sdk-core/crates/sdk-core/src/worker/workflow/driven_workflow.rs +9 -3
- package/sdk-core/crates/sdk-core/src/worker/workflow/machines/patch_state_machine.rs +5 -8
- package/sdk-core/crates/sdk-core/src/worker/workflow/machines/upsert_search_attributes_state_machine.rs +21 -22
- package/sdk-core/crates/sdk-core/src/worker/workflow/machines/workflow_machines.rs +28 -4
- package/sdk-core/crates/sdk-core/src/worker/workflow/managed_run.rs +20 -41
- package/sdk-core/crates/sdk-core/src/worker/workflow/mod.rs +50 -9
- package/sdk-core/crates/sdk-core/src/worker/workflow/run_cache.rs +4 -7
- package/sdk-core/crates/sdk-core/src/worker/workflow/wft_extraction.rs +2 -4
- package/sdk-core/crates/sdk-core/src/worker/workflow/wft_poller.rs +8 -9
- package/sdk-core/crates/sdk-core/src/worker/workflow/workflow_stream.rs +1 -3
- package/sdk-core/crates/sdk-core/tests/activities_procmacro.rs +6 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/basic_pass.rs +54 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/invalid_self_type_fail.rs +18 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/invalid_self_type_fail.stderr +5 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/missing_context_fail.rs +14 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/missing_context_fail.stderr +5 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/multi_arg_pass.rs +48 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/no_input_pass.rs +14 -0
- package/sdk-core/crates/sdk-core/tests/activities_trybuild/no_return_type_pass.rs +19 -0
- package/sdk-core/crates/sdk-core/tests/cloud_tests.rs +14 -5
- package/sdk-core/crates/sdk-core/tests/common/activity_functions.rs +55 -0
- package/sdk-core/crates/sdk-core/tests/common/mod.rs +281 -236
- package/sdk-core/crates/sdk-core/tests/common/workflows.rs +41 -28
- package/sdk-core/crates/sdk-core/tests/global_metric_tests.rs +9 -14
- package/sdk-core/crates/sdk-core/tests/heavy_tests/fuzzy_workflow.rs +73 -66
- package/sdk-core/crates/sdk-core/tests/heavy_tests.rs +306 -268
- package/sdk-core/crates/sdk-core/tests/integ_tests/async_activity_client_tests.rs +230 -0
- package/sdk-core/crates/sdk-core/tests/integ_tests/client_tests.rs +94 -57
- package/sdk-core/crates/sdk-core/tests/integ_tests/data_converter_tests.rs +381 -0
- package/sdk-core/crates/sdk-core/tests/integ_tests/ephemeral_server_tests.rs +37 -38
- package/sdk-core/crates/sdk-core/tests/integ_tests/heartbeat_tests.rs +49 -40
- package/sdk-core/crates/sdk-core/tests/integ_tests/metrics_tests.rs +447 -300
- package/sdk-core/crates/sdk-core/tests/integ_tests/pagination_tests.rs +50 -45
- package/sdk-core/crates/sdk-core/tests/integ_tests/polling_tests.rs +157 -157
- package/sdk-core/crates/sdk-core/tests/integ_tests/queries_tests.rs +103 -89
- package/sdk-core/crates/sdk-core/tests/integ_tests/update_tests.rs +609 -463
- package/sdk-core/crates/sdk-core/tests/integ_tests/visibility_tests.rs +80 -62
- package/sdk-core/crates/sdk-core/tests/integ_tests/worker_heartbeat_tests.rs +389 -265
- package/sdk-core/crates/sdk-core/tests/integ_tests/worker_tests.rs +250 -185
- package/sdk-core/crates/sdk-core/tests/integ_tests/worker_versioning_tests.rs +52 -49
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_client_tests.rs +180 -0
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/activities.rs +437 -327
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/cancel_external.rs +82 -58
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/cancel_wf.rs +56 -30
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/child_workflows.rs +364 -251
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/client_interactions.rs +552 -0
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/continue_as_new.rs +110 -46
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/determinism.rs +243 -149
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/eager.rs +98 -32
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/local_activities.rs +1475 -1040
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/modify_wf_properties.rs +73 -43
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/nexus.rs +402 -245
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/patches.rs +343 -207
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/queries.rs +415 -0
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/replay.rs +96 -36
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/resets.rs +155 -140
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/signals.rs +183 -113
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/stickyness.rs +85 -44
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/timers.rs +142 -48
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/upsert_search_attrs.rs +73 -56
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests.rs +365 -242
- package/sdk-core/crates/sdk-core/tests/main.rs +22 -16
- package/sdk-core/crates/sdk-core/tests/manual_tests.rs +233 -187
- package/sdk-core/crates/sdk-core/tests/runner.rs +4 -6
- package/sdk-core/crates/sdk-core/tests/shared_tests/mod.rs +73 -27
- package/sdk-core/crates/sdk-core/tests/shared_tests/priority.rs +107 -84
- package/sdk-core/crates/sdk-core/tests/workflows_procmacro.rs +6 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/async_query_fail.rs +26 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/async_query_fail.stderr +5 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/basic_pass.rs +49 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/minimal_pass.rs +21 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/mut_query_fail.rs +26 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/mut_query_fail.stderr +5 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/sync_run_fail.rs +21 -0
- package/sdk-core/crates/sdk-core/tests/workflows_trybuild/sync_run_fail.stderr +5 -0
- package/sdk-core/crates/sdk-core-c-bridge/Cargo.toml +8 -1
- package/sdk-core/crates/sdk-core-c-bridge/include/temporal-sdk-core-c-bridge.h +37 -26
- package/sdk-core/crates/sdk-core-c-bridge/src/client.rs +180 -87
- package/sdk-core/crates/sdk-core-c-bridge/src/lib.rs +89 -5
- package/sdk-core/crates/sdk-core-c-bridge/src/metric.rs +10 -16
- package/sdk-core/crates/sdk-core-c-bridge/src/runtime.rs +59 -67
- package/sdk-core/crates/sdk-core-c-bridge/src/testing.rs +10 -10
- package/sdk-core/crates/sdk-core-c-bridge/src/tests/context.rs +57 -22
- package/sdk-core/crates/sdk-core-c-bridge/src/tests/mod.rs +108 -12
- package/sdk-core/crates/sdk-core-c-bridge/src/tests/utils.rs +9 -52
- package/sdk-core/crates/sdk-core-c-bridge/src/worker.rs +74 -91
- package/sdk-core/rustfmt.toml +2 -1
- package/src/client.rs +206 -289
- package/src/helpers/try_into_js.rs +88 -2
- package/src/metrics.rs +277 -35
- package/src/runtime.rs +94 -45
- package/src/testing.rs +9 -16
- package/src/worker.rs +86 -68
- package/ts/native.ts +39 -3
- package/sdk-core/crates/client/src/workflow_handle/mod.rs +0 -212
- package/sdk-core/crates/common/src/errors.rs +0 -85
- package/sdk-core/crates/common/tests/worker_task_types_test.rs +0 -129
- package/sdk-core/crates/macros/LICENSE.txt +0 -21
- package/sdk-core/crates/sdk/src/activity_context.rs +0 -238
- package/sdk-core/crates/sdk/src/app_data.rs +0 -37
- package/sdk-core/crates/sdk-core/tests/integ_tests/activity_functions.rs +0 -5
- package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/appdata_propagation.rs +0 -61
|
@@ -57,10 +57,7 @@ pub extern "C" fn temporal_core_metric_attributes_new(
|
|
|
57
57
|
size: libc::size_t,
|
|
58
58
|
) -> *mut MetricAttributes {
|
|
59
59
|
let meter = unsafe { &*meter };
|
|
60
|
-
let orig = meter
|
|
61
|
-
.core
|
|
62
|
-
.inner
|
|
63
|
-
.new_attributes(meter.core.default_attribs.clone());
|
|
60
|
+
let orig = meter.core.get_default_attributes().clone();
|
|
64
61
|
Box::into_raw(Box::new(metric_attributes_append(
|
|
65
62
|
meter, &orig, attrs, size,
|
|
66
63
|
)))
|
|
@@ -94,7 +91,7 @@ fn metric_attributes_append(
|
|
|
94
91
|
size: libc::size_t,
|
|
95
92
|
) -> MetricAttributes {
|
|
96
93
|
let attrs = unsafe { std::slice::from_raw_parts(attrs, size) };
|
|
97
|
-
let core = meter.core.
|
|
94
|
+
let core = meter.core.extend_attributes(
|
|
98
95
|
orig.clone(),
|
|
99
96
|
metrics::NewAttributes {
|
|
100
97
|
attributes: attrs.iter().map(metric_attribute_to_key_value).collect(),
|
|
@@ -158,20 +155,18 @@ pub extern "C" fn temporal_core_metric_new(
|
|
|
158
155
|
let meter = unsafe { &*meter };
|
|
159
156
|
let options = unsafe { &*options };
|
|
160
157
|
Box::into_raw(Box::new(match options.kind {
|
|
161
|
-
MetricKind::CounterInteger =>
|
|
162
|
-
Metric::CounterInteger(meter.core.inner.counter(options.into()))
|
|
163
|
-
}
|
|
158
|
+
MetricKind::CounterInteger => Metric::CounterInteger(meter.core.counter(options.into())),
|
|
164
159
|
MetricKind::HistogramInteger => {
|
|
165
|
-
Metric::HistogramInteger(meter.core.
|
|
160
|
+
Metric::HistogramInteger(meter.core.histogram(options.into()))
|
|
166
161
|
}
|
|
167
162
|
MetricKind::HistogramFloat => {
|
|
168
|
-
Metric::HistogramFloat(meter.core.
|
|
163
|
+
Metric::HistogramFloat(meter.core.histogram_f64(options.into()))
|
|
169
164
|
}
|
|
170
165
|
MetricKind::HistogramDuration => {
|
|
171
|
-
Metric::HistogramDuration(meter.core.
|
|
166
|
+
Metric::HistogramDuration(meter.core.histogram_duration(options.into()))
|
|
172
167
|
}
|
|
173
|
-
MetricKind::GaugeInteger => Metric::GaugeInteger(meter.core.
|
|
174
|
-
MetricKind::GaugeFloat => Metric::GaugeFloat(meter.core.
|
|
168
|
+
MetricKind::GaugeInteger => Metric::GaugeInteger(meter.core.gauge(options.into())),
|
|
169
|
+
MetricKind::GaugeFloat => Metric::GaugeFloat(meter.core.gauge_f64(options.into())),
|
|
175
170
|
}))
|
|
176
171
|
}
|
|
177
172
|
|
|
@@ -231,12 +226,11 @@ pub extern "C" fn temporal_core_metric_record_duration(
|
|
|
231
226
|
|
|
232
227
|
impl From<&MetricOptions> for metrics::MetricParameters {
|
|
233
228
|
fn from(options: &MetricOptions) -> Self {
|
|
234
|
-
metrics::
|
|
229
|
+
metrics::MetricParameters::builder()
|
|
235
230
|
.name(options.name.to_string())
|
|
236
231
|
.description(options.description.to_string())
|
|
237
232
|
.unit(options.unit.to_string())
|
|
238
233
|
.build()
|
|
239
|
-
.unwrap()
|
|
240
234
|
}
|
|
241
235
|
}
|
|
242
236
|
|
|
@@ -484,7 +478,7 @@ struct CustomMetricAttributes {
|
|
|
484
478
|
unsafe impl Send for CustomMetricAttributes {}
|
|
485
479
|
unsafe impl Sync for CustomMetricAttributes {}
|
|
486
480
|
|
|
487
|
-
impl metrics::CustomMetricAttributes for CustomMetricAttributes {
|
|
481
|
+
impl metrics::core::CustomMetricAttributes for CustomMetricAttributes {
|
|
488
482
|
fn as_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync> {
|
|
489
483
|
self as Arc<dyn Any + Send + Sync>
|
|
490
484
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
use crate::{
|
|
2
|
-
ByteArray, ByteArrayRef,
|
|
2
|
+
ByteArray, ByteArrayRef, NewlineDelimitedMapRef,
|
|
3
3
|
metric::{CustomMetricMeter, CustomMetricMeterRef},
|
|
4
4
|
};
|
|
5
5
|
|
|
@@ -17,13 +17,11 @@ use std::{
|
|
|
17
17
|
};
|
|
18
18
|
use temporalio_common::telemetry::{
|
|
19
19
|
CoreLog, CoreLogConsumer, HistogramBucketOverrides, Logger, MetricTemporality,
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
OtelCollectorOptions, PrometheusExporterOptions, TelemetryOptions as CoreTelemetryOptions,
|
|
21
|
+
build_otlp_metric_exporter, metrics::CoreMeter, start_prometheus_metric_exporter,
|
|
22
22
|
};
|
|
23
23
|
use temporalio_sdk_core::{
|
|
24
|
-
CoreRuntime, RuntimeOptions as CoreRuntimeOptions,
|
|
25
|
-
RuntimeOptionsBuilder as CoreRuntimeOptionsBuilder, TokioRuntimeBuilder,
|
|
26
|
-
telemetry::{build_otlp_metric_exporter, start_prometheus_metric_exporter},
|
|
24
|
+
CoreRuntime, RuntimeOptions as CoreRuntimeOptions, TokioRuntimeBuilder as TokioRuntime,
|
|
27
25
|
};
|
|
28
26
|
use tracing::Level;
|
|
29
27
|
use url::Url;
|
|
@@ -76,21 +74,21 @@ pub struct MetricsOptions {
|
|
|
76
74
|
pub custom_meter: *const CustomMetricMeter,
|
|
77
75
|
|
|
78
76
|
pub attach_service_name: bool,
|
|
79
|
-
pub global_tags:
|
|
77
|
+
pub global_tags: NewlineDelimitedMapRef,
|
|
80
78
|
pub metric_prefix: ByteArrayRef,
|
|
81
79
|
}
|
|
82
80
|
|
|
83
81
|
#[repr(C)]
|
|
84
82
|
pub struct OpenTelemetryOptions {
|
|
85
83
|
pub url: ByteArrayRef,
|
|
86
|
-
pub headers:
|
|
84
|
+
pub headers: NewlineDelimitedMapRef,
|
|
87
85
|
pub metric_periodicity_millis: u32,
|
|
88
86
|
pub metric_temporality: OpenTelemetryMetricTemporality,
|
|
89
87
|
pub durations_as_seconds: bool,
|
|
90
88
|
pub protocol: OpenTelemetryProtocol,
|
|
91
89
|
/// Histogram bucket overrides in form of
|
|
92
90
|
/// `<metric1>\n<float>,<float>,<float>\n<metric2>\n<float>,<float>,<float>`
|
|
93
|
-
pub histogram_bucket_overrides:
|
|
91
|
+
pub histogram_bucket_overrides: NewlineDelimitedMapRef,
|
|
94
92
|
}
|
|
95
93
|
|
|
96
94
|
#[repr(C)]
|
|
@@ -113,7 +111,7 @@ pub struct PrometheusOptions {
|
|
|
113
111
|
pub durations_as_seconds: bool,
|
|
114
112
|
/// Histogram bucket overrides in form of
|
|
115
113
|
/// `<metric1>\n<float>,<float>,<float>\n<metric2>\n<float>,<float>,<float>`
|
|
116
|
-
pub histogram_bucket_overrides:
|
|
114
|
+
pub histogram_bucket_overrides: NewlineDelimitedMapRef,
|
|
117
115
|
}
|
|
118
116
|
|
|
119
117
|
#[derive(Clone)]
|
|
@@ -143,11 +141,8 @@ pub extern "C" fn temporal_core_runtime_new(options: *const RuntimeOptions) -> R
|
|
|
143
141
|
// freeable
|
|
144
142
|
let mut runtime = Runtime {
|
|
145
143
|
core: Arc::new(
|
|
146
|
-
CoreRuntime::new(
|
|
147
|
-
|
|
148
|
-
TokioRuntimeBuilder::default(),
|
|
149
|
-
)
|
|
150
|
-
.unwrap(),
|
|
144
|
+
CoreRuntime::new(CoreRuntimeOptions::default(), TokioRuntime::default())
|
|
145
|
+
.unwrap(),
|
|
151
146
|
),
|
|
152
147
|
log_forwarder: None,
|
|
153
148
|
};
|
|
@@ -207,19 +202,15 @@ impl Runtime {
|
|
|
207
202
|
// Build telemetry options
|
|
208
203
|
let mut log_forwarder = None;
|
|
209
204
|
let telemetry_options = if let Some(v) = unsafe { options.telemetry.as_ref() } {
|
|
210
|
-
let
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
build.metric_prefix(metric_prefix);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
205
|
+
let (attach_service_name, metric_prefix) =
|
|
206
|
+
if let Some(v) = unsafe { v.metrics.as_ref() } {
|
|
207
|
+
(v.attach_service_name, v.metric_prefix.to_option_string())
|
|
208
|
+
} else {
|
|
209
|
+
(true, None)
|
|
210
|
+
};
|
|
219
211
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
build.logging(if let Some(callback) = v.forward_to {
|
|
212
|
+
let logging = unsafe { v.logging.as_ref() }.map(|v| {
|
|
213
|
+
if let Some(callback) = v.forward_to {
|
|
223
214
|
let consumer = Arc::new(LogForwarder {
|
|
224
215
|
callback,
|
|
225
216
|
active: AtomicBool::new(false),
|
|
@@ -233,28 +224,29 @@ impl Runtime {
|
|
|
233
224
|
Logger::Console {
|
|
234
225
|
filter: v.filter.to_string(),
|
|
235
226
|
}
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
build.build()?
|
|
239
|
-
} else {
|
|
240
|
-
CoreTelemetryOptions::default()
|
|
241
|
-
};
|
|
227
|
+
}
|
|
228
|
+
});
|
|
242
229
|
|
|
243
|
-
|
|
244
|
-
|
|
230
|
+
CoreTelemetryOptions::builder()
|
|
231
|
+
.attach_service_name(attach_service_name)
|
|
232
|
+
.maybe_metric_prefix(metric_prefix)
|
|
233
|
+
.maybe_logging(logging)
|
|
234
|
+
.build()
|
|
245
235
|
} else {
|
|
246
|
-
|
|
247
|
-
options.worker_heartbeat_interval_millis,
|
|
248
|
-
))
|
|
236
|
+
CoreTelemetryOptions::default()
|
|
249
237
|
};
|
|
250
238
|
|
|
251
|
-
let core_runtime_options =
|
|
239
|
+
let core_runtime_options = CoreRuntimeOptions::builder()
|
|
252
240
|
.telemetry_options(telemetry_options)
|
|
253
|
-
.heartbeat_interval(
|
|
254
|
-
|
|
241
|
+
.heartbeat_interval(
|
|
242
|
+
(options.worker_heartbeat_interval_millis != 0)
|
|
243
|
+
.then(|| Duration::from_millis(options.worker_heartbeat_interval_millis)),
|
|
244
|
+
)
|
|
245
|
+
.build()
|
|
246
|
+
.map_err(|e| anyhow::anyhow!(e))?;
|
|
255
247
|
|
|
256
248
|
// Build core runtime
|
|
257
|
-
let mut core = CoreRuntime::new(core_runtime_options,
|
|
249
|
+
let mut core = CoreRuntime::new(core_runtime_options, TokioRuntime::default())?;
|
|
258
250
|
|
|
259
251
|
// We late-bind the metrics after core runtime is created since it needs
|
|
260
252
|
// the Tokio handle
|
|
@@ -392,27 +384,28 @@ fn create_meter(
|
|
|
392
384
|
));
|
|
393
385
|
}
|
|
394
386
|
// Build OTel exporter
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
387
|
+
Ok(Arc::new(build_otlp_metric_exporter(
|
|
388
|
+
OtelCollectorOptions::builder()
|
|
389
|
+
.url(Url::parse(otel_options.url.to_str())?)
|
|
390
|
+
.headers(otel_options.headers.to_string_map_on_newlines())
|
|
391
|
+
.metric_temporality(match otel_options.metric_temporality {
|
|
392
|
+
OpenTelemetryMetricTemporality::Cumulative => MetricTemporality::Cumulative,
|
|
393
|
+
OpenTelemetryMetricTemporality::Delta => MetricTemporality::Delta,
|
|
394
|
+
})
|
|
395
|
+
.global_tags(options.global_tags.to_string_map_on_newlines())
|
|
396
|
+
.use_seconds_for_durations(otel_options.durations_as_seconds)
|
|
397
|
+
.histogram_bucket_overrides(HistogramBucketOverrides {
|
|
398
|
+
overrides: parse_histogram_bucket_overrides(
|
|
399
|
+
&otel_options.histogram_bucket_overrides,
|
|
400
|
+
)?,
|
|
401
|
+
})
|
|
402
|
+
.maybe_metric_periodicity(
|
|
403
|
+
(otel_options.metric_periodicity_millis > 0).then(|| {
|
|
404
|
+
Duration::from_millis(otel_options.metric_periodicity_millis.into())
|
|
405
|
+
}),
|
|
406
|
+
)
|
|
407
|
+
.build(),
|
|
408
|
+
)?))
|
|
416
409
|
} else if let Some(prom_options) = unsafe { options.prometheus.as_ref() } {
|
|
417
410
|
if custom_meter.is_some() {
|
|
418
411
|
return Err(anyhow::anyhow!(
|
|
@@ -420,8 +413,7 @@ fn create_meter(
|
|
|
420
413
|
));
|
|
421
414
|
}
|
|
422
415
|
// Start prom exporter
|
|
423
|
-
let
|
|
424
|
-
build
|
|
416
|
+
let build = PrometheusExporterOptions::builder()
|
|
425
417
|
.socket_addr(SocketAddr::from_str(prom_options.bind_address.to_str())?)
|
|
426
418
|
.global_tags(options.global_tags.to_string_map_on_newlines())
|
|
427
419
|
.counters_total_suffix(prom_options.counters_total_suffix)
|
|
@@ -432,7 +424,7 @@ fn create_meter(
|
|
|
432
424
|
&prom_options.histogram_bucket_overrides,
|
|
433
425
|
)?,
|
|
434
426
|
});
|
|
435
|
-
Ok(start_prometheus_metric_exporter(build.build()
|
|
427
|
+
Ok(start_prometheus_metric_exporter(build.build())?.meter)
|
|
436
428
|
} else if let Some(custom_meter) = custom_meter {
|
|
437
429
|
Ok(Arc::new(custom_meter))
|
|
438
430
|
} else {
|
|
@@ -443,7 +435,7 @@ fn create_meter(
|
|
|
443
435
|
}
|
|
444
436
|
|
|
445
437
|
fn parse_histogram_bucket_overrides(
|
|
446
|
-
raw: &
|
|
438
|
+
raw: &NewlineDelimitedMapRef,
|
|
447
439
|
) -> anyhow::Result<HashMap<String, Vec<f64>>> {
|
|
448
440
|
raw.to_string_map_on_newlines()
|
|
449
441
|
.into_iter()
|
|
@@ -203,24 +203,24 @@ impl TryFrom<&DevServerOptions> for ephemeral_server::TemporalDevServerConfig {
|
|
|
203
203
|
|
|
204
204
|
fn try_from(options: &DevServerOptions) -> anyhow::Result<Self> {
|
|
205
205
|
let test_server_options = unsafe { &*options.test_server };
|
|
206
|
-
Ok(ephemeral_server::
|
|
206
|
+
Ok(ephemeral_server::TemporalDevServerConfig::builder()
|
|
207
207
|
.exe(test_server_options.exe())
|
|
208
208
|
.namespace(options.namespace.to_string())
|
|
209
209
|
.ip(options.ip.to_string())
|
|
210
|
-
.
|
|
211
|
-
.
|
|
210
|
+
.maybe_port(test_server_options.port())
|
|
211
|
+
.maybe_db_filename(options.database_filename.to_option_string())
|
|
212
212
|
.ui(options.ui)
|
|
213
|
-
.
|
|
214
|
-
None
|
|
215
|
-
} else {
|
|
213
|
+
.maybe_ui_port(if options.ui_port != 0 && options.ui {
|
|
216
214
|
Some(options.ui_port)
|
|
215
|
+
} else {
|
|
216
|
+
None
|
|
217
217
|
})
|
|
218
218
|
.log((
|
|
219
219
|
options.log_format.to_string(),
|
|
220
220
|
options.log_level.to_string(),
|
|
221
221
|
))
|
|
222
222
|
.extra_args(test_server_options.extra_args())
|
|
223
|
-
.build()
|
|
223
|
+
.build())
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
|
|
@@ -228,11 +228,11 @@ impl TryFrom<&TestServerOptions> for ephemeral_server::TestServerConfig {
|
|
|
228
228
|
type Error = anyhow::Error;
|
|
229
229
|
|
|
230
230
|
fn try_from(options: &TestServerOptions) -> anyhow::Result<Self> {
|
|
231
|
-
Ok(ephemeral_server::
|
|
231
|
+
Ok(ephemeral_server::TestServerConfig::builder()
|
|
232
232
|
.exe(options.exe())
|
|
233
|
-
.
|
|
233
|
+
.maybe_port(options.port())
|
|
234
234
|
.extra_args(options.extra_args())
|
|
235
|
-
.build()
|
|
235
|
+
.build())
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
use crate::{
|
|
2
2
|
client::{
|
|
3
|
-
|
|
4
|
-
ClientTlsOptions,
|
|
5
|
-
temporal_core_client_rpc_call,
|
|
3
|
+
ClientHttpConnectProxyOptions, ClientKeepAliveOptions, ClientRetryOptions,
|
|
4
|
+
ClientTlsOptions, Connection, GrpcMetadataHolder, RpcCallOptions,
|
|
5
|
+
temporal_core_client_connect, temporal_core_client_free, temporal_core_client_rpc_call,
|
|
6
6
|
},
|
|
7
7
|
runtime::{
|
|
8
8
|
Runtime, RuntimeOptions, RuntimeOrFail, temporal_core_byte_array_free,
|
|
@@ -17,19 +17,19 @@ use crate::{
|
|
|
17
17
|
use crate::{
|
|
18
18
|
ByteArray, ByteArrayRef,
|
|
19
19
|
tests::utils::{
|
|
20
|
-
|
|
21
|
-
pointer_or_null,
|
|
20
|
+
OwnedRpcCallOptions, RpcCallError, byte_array_to_string, byte_array_to_vec, pointer_or_null,
|
|
22
21
|
},
|
|
23
22
|
};
|
|
24
23
|
use anyhow::anyhow;
|
|
25
24
|
use std::{
|
|
26
25
|
any::Any,
|
|
26
|
+
collections::HashMap,
|
|
27
27
|
panic::{AssertUnwindSafe, UnwindSafe},
|
|
28
28
|
ptr::NonNull,
|
|
29
29
|
sync::{Arc, Condvar, Mutex, MutexGuard, PoisonError, Weak},
|
|
30
30
|
time::Duration,
|
|
31
31
|
};
|
|
32
|
-
use temporalio_client::
|
|
32
|
+
use temporalio_client::ConnectionOptions;
|
|
33
33
|
use temporalio_sdk_core::ephemeral_server::{
|
|
34
34
|
EphemeralExe, EphemeralExeVersion, TemporalDevServerConfig,
|
|
35
35
|
};
|
|
@@ -48,7 +48,7 @@ struct InnerContext {
|
|
|
48
48
|
runtime: *mut Runtime,
|
|
49
49
|
ephemeral_server: *mut EphemeralServer,
|
|
50
50
|
ephemeral_server_target: String,
|
|
51
|
-
client: *mut
|
|
51
|
+
client: *mut Connection,
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
unsafe impl Send for InnerContext {}
|
|
@@ -104,7 +104,7 @@ impl Context {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
#[allow(dead_code)]
|
|
107
|
-
pub fn client(&self) -> anyhow::Result<Option<NonNull<
|
|
107
|
+
pub fn client(&self) -> anyhow::Result<Option<NonNull<Connection>>> {
|
|
108
108
|
Ok(NonNull::new(self.wait_for_available()?.client))
|
|
109
109
|
}
|
|
110
110
|
|
|
@@ -279,20 +279,20 @@ impl Context {
|
|
|
279
279
|
self.wait_for_operation()
|
|
280
280
|
}
|
|
281
281
|
|
|
282
|
-
pub fn client_connect(self: &Arc<Self>, options: Box<
|
|
282
|
+
pub fn client_connect(self: &Arc<Self>, options: Box<ConnectionOptions>) -> anyhow::Result<()> {
|
|
283
283
|
Self::client_connect_with_override(self, options, None, std::ptr::null_mut())
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
pub fn client_connect_with_override(
|
|
287
287
|
self: &Arc<Self>,
|
|
288
|
-
options: Box<
|
|
288
|
+
options: Box<ConnectionOptions>,
|
|
289
289
|
grpc_override_callback: crate::client::ClientGrpcOverrideCallback,
|
|
290
290
|
grpc_override_callback_user_data: *mut libc::c_void,
|
|
291
291
|
) -> anyhow::Result<()> {
|
|
292
|
-
let metadata = options
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
.map(
|
|
292
|
+
let metadata: Option<GrpcMetadataHolder> = options.headers.as_ref().map(Into::into);
|
|
293
|
+
|
|
294
|
+
let binary_metadata: Option<GrpcMetadataHolder> =
|
|
295
|
+
options.binary_headers.as_ref().map(Into::into);
|
|
296
296
|
|
|
297
297
|
let tls_options = options.tls_options.as_ref().map(|tls_cfg| {
|
|
298
298
|
let client_tls_cfg = tls_cfg.client_tls_options.as_ref();
|
|
@@ -340,11 +340,12 @@ impl Context {
|
|
|
340
340
|
})
|
|
341
341
|
});
|
|
342
342
|
|
|
343
|
-
let client_options = Box::new(crate::client::
|
|
344
|
-
target_url: options.
|
|
345
|
-
client_name: options.
|
|
346
|
-
client_version: options.
|
|
347
|
-
metadata: metadata.
|
|
343
|
+
let client_options = Box::new(crate::client::ConnectionOptions {
|
|
344
|
+
target_url: options.target.as_str().into(),
|
|
345
|
+
client_name: options.get_client_name().into(),
|
|
346
|
+
client_version: options.get_client_version().into(),
|
|
347
|
+
metadata: metadata.as_ref().into(),
|
|
348
|
+
binary_metadata: binary_metadata.as_ref().into(),
|
|
348
349
|
api_key: options.api_key.as_deref().into(),
|
|
349
350
|
identity: options.identity.as_str().into(),
|
|
350
351
|
tls_options: pointer_or_null(tls_options.as_deref()),
|
|
@@ -362,6 +363,7 @@ impl Context {
|
|
|
362
363
|
_allocations: Box::new((
|
|
363
364
|
options,
|
|
364
365
|
metadata,
|
|
366
|
+
binary_metadata,
|
|
365
367
|
tls_options,
|
|
366
368
|
retry_options,
|
|
367
369
|
keep_alive_options,
|
|
@@ -390,14 +392,15 @@ impl Context {
|
|
|
390
392
|
|
|
391
393
|
pub fn rpc_call(
|
|
392
394
|
self: &Arc<Self>,
|
|
393
|
-
|
|
395
|
+
options: Box<OwnedRpcCallOptions>,
|
|
394
396
|
) -> anyhow::Result<Vec<u8>> {
|
|
395
397
|
let c_options = Box::new(RpcCallOptions {
|
|
396
398
|
service: options.service,
|
|
397
399
|
rpc: options.rpc.as_str().into(),
|
|
398
400
|
req: options.req.as_slice().into(),
|
|
399
401
|
retry: options.retry,
|
|
400
|
-
metadata: options.metadata.
|
|
402
|
+
metadata: options.metadata.as_ref().into(),
|
|
403
|
+
binary_metadata: options.binary_metadata.as_ref().into(),
|
|
401
404
|
timeout_millis: options.timeout_millis,
|
|
402
405
|
cancellation_token: options
|
|
403
406
|
.cancellation_token
|
|
@@ -579,7 +582,7 @@ extern "C" fn ephemeral_server_shutdown_callback(
|
|
|
579
582
|
|
|
580
583
|
extern "C" fn client_connect_callback(
|
|
581
584
|
user_data: *mut libc::c_void,
|
|
582
|
-
mut client: *mut
|
|
585
|
+
mut client: *mut Connection,
|
|
583
586
|
mut fail: *const ByteArray,
|
|
584
587
|
) {
|
|
585
588
|
let user_data = unsafe { Box::from_raw(user_data as *mut CallbackUserData<(), Context>) };
|
|
@@ -654,3 +657,35 @@ extern "C" fn rpc_call_callback(
|
|
|
654
657
|
temporal_core_byte_array_free(std::ptr::null_mut(), failure_details);
|
|
655
658
|
}
|
|
656
659
|
}
|
|
660
|
+
|
|
661
|
+
impl From<&HashMap<String, String>> for GrpcMetadataHolder {
|
|
662
|
+
fn from(value: &HashMap<String, String>) -> GrpcMetadataHolder {
|
|
663
|
+
let refs: Vec<Vec<u8>> = value
|
|
664
|
+
.iter()
|
|
665
|
+
.map(|(k, v)| format!("{k}\n{v}").into_bytes())
|
|
666
|
+
.collect();
|
|
667
|
+
|
|
668
|
+
GrpcMetadataHolder {
|
|
669
|
+
data: refs.iter().map(ByteArrayRef::from).collect(),
|
|
670
|
+
_allocations: refs,
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
impl From<&HashMap<String, Vec<u8>>> for GrpcMetadataHolder {
|
|
676
|
+
fn from(value: &HashMap<String, Vec<u8>>) -> GrpcMetadataHolder {
|
|
677
|
+
let refs: Vec<Vec<u8>> = value
|
|
678
|
+
.iter()
|
|
679
|
+
.map(|(k, v)| {
|
|
680
|
+
let mut nv = format!("{k}\n").into_bytes();
|
|
681
|
+
nv.extend(v);
|
|
682
|
+
nv
|
|
683
|
+
})
|
|
684
|
+
.collect();
|
|
685
|
+
|
|
686
|
+
GrpcMetadataHolder {
|
|
687
|
+
data: refs.iter().map(ByteArrayRef::from).collect(),
|
|
688
|
+
_allocations: refs,
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
}
|