@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
|
@@ -0,0 +1,817 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <stdarg.h>
|
|
4
|
+
#include <stdbool.h>
|
|
5
|
+
#include <stdint.h>
|
|
6
|
+
#include <stdlib.h>
|
|
7
|
+
|
|
8
|
+
typedef enum TemporalCoreForwardedLogLevel {
|
|
9
|
+
Trace = 0,
|
|
10
|
+
Debug,
|
|
11
|
+
Info,
|
|
12
|
+
Warn,
|
|
13
|
+
Error,
|
|
14
|
+
} TemporalCoreForwardedLogLevel;
|
|
15
|
+
|
|
16
|
+
typedef enum TemporalCoreMetricAttributeValueType {
|
|
17
|
+
String = 1,
|
|
18
|
+
Int,
|
|
19
|
+
Float,
|
|
20
|
+
Bool,
|
|
21
|
+
} TemporalCoreMetricAttributeValueType;
|
|
22
|
+
|
|
23
|
+
typedef enum TemporalCoreMetricKind {
|
|
24
|
+
CounterInteger = 1,
|
|
25
|
+
HistogramInteger,
|
|
26
|
+
HistogramFloat,
|
|
27
|
+
HistogramDuration,
|
|
28
|
+
GaugeInteger,
|
|
29
|
+
GaugeFloat,
|
|
30
|
+
} TemporalCoreMetricKind;
|
|
31
|
+
|
|
32
|
+
typedef enum TemporalCoreOpenTelemetryMetricTemporality {
|
|
33
|
+
Cumulative = 1,
|
|
34
|
+
Delta,
|
|
35
|
+
} TemporalCoreOpenTelemetryMetricTemporality;
|
|
36
|
+
|
|
37
|
+
typedef enum TemporalCoreOpenTelemetryProtocol {
|
|
38
|
+
Grpc = 1,
|
|
39
|
+
Http,
|
|
40
|
+
} TemporalCoreOpenTelemetryProtocol;
|
|
41
|
+
|
|
42
|
+
typedef enum TemporalCoreRpcService {
|
|
43
|
+
Workflow = 1,
|
|
44
|
+
Operator,
|
|
45
|
+
Cloud,
|
|
46
|
+
Test,
|
|
47
|
+
Health,
|
|
48
|
+
} TemporalCoreRpcService;
|
|
49
|
+
|
|
50
|
+
typedef enum TemporalCoreSlotKindType {
|
|
51
|
+
WorkflowSlotKindType,
|
|
52
|
+
ActivitySlotKindType,
|
|
53
|
+
LocalActivitySlotKindType,
|
|
54
|
+
NexusSlotKindType,
|
|
55
|
+
} TemporalCoreSlotKindType;
|
|
56
|
+
|
|
57
|
+
typedef struct TemporalCoreCancellationToken TemporalCoreCancellationToken;
|
|
58
|
+
|
|
59
|
+
typedef struct TemporalCoreClient TemporalCoreClient;
|
|
60
|
+
|
|
61
|
+
typedef struct TemporalCoreEphemeralServer TemporalCoreEphemeralServer;
|
|
62
|
+
|
|
63
|
+
typedef struct TemporalCoreForwardedLog TemporalCoreForwardedLog;
|
|
64
|
+
|
|
65
|
+
typedef struct TemporalCoreMetric TemporalCoreMetric;
|
|
66
|
+
|
|
67
|
+
typedef struct TemporalCoreMetricAttributes TemporalCoreMetricAttributes;
|
|
68
|
+
|
|
69
|
+
typedef struct TemporalCoreMetricMeter TemporalCoreMetricMeter;
|
|
70
|
+
|
|
71
|
+
typedef struct TemporalCoreRandom TemporalCoreRandom;
|
|
72
|
+
|
|
73
|
+
typedef struct TemporalCoreRuntime TemporalCoreRuntime;
|
|
74
|
+
|
|
75
|
+
typedef struct TemporalCoreWorker TemporalCoreWorker;
|
|
76
|
+
|
|
77
|
+
typedef struct TemporalCoreWorkerReplayPusher TemporalCoreWorkerReplayPusher;
|
|
78
|
+
|
|
79
|
+
typedef struct TemporalCoreByteArrayRef {
|
|
80
|
+
const uint8_t *data;
|
|
81
|
+
size_t size;
|
|
82
|
+
} TemporalCoreByteArrayRef;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Metadata is <key1>\n<value1>\n<key2>\n<value2>. Metadata keys or
|
|
86
|
+
* values cannot contain a newline within.
|
|
87
|
+
*/
|
|
88
|
+
typedef struct TemporalCoreByteArrayRef TemporalCoreMetadataRef;
|
|
89
|
+
|
|
90
|
+
typedef struct TemporalCoreClientTlsOptions {
|
|
91
|
+
struct TemporalCoreByteArrayRef server_root_ca_cert;
|
|
92
|
+
struct TemporalCoreByteArrayRef domain;
|
|
93
|
+
struct TemporalCoreByteArrayRef client_cert;
|
|
94
|
+
struct TemporalCoreByteArrayRef client_private_key;
|
|
95
|
+
} TemporalCoreClientTlsOptions;
|
|
96
|
+
|
|
97
|
+
typedef struct TemporalCoreClientRetryOptions {
|
|
98
|
+
uint64_t initial_interval_millis;
|
|
99
|
+
double randomization_factor;
|
|
100
|
+
double multiplier;
|
|
101
|
+
uint64_t max_interval_millis;
|
|
102
|
+
uint64_t max_elapsed_time_millis;
|
|
103
|
+
uintptr_t max_retries;
|
|
104
|
+
} TemporalCoreClientRetryOptions;
|
|
105
|
+
|
|
106
|
+
typedef struct TemporalCoreClientKeepAliveOptions {
|
|
107
|
+
uint64_t interval_millis;
|
|
108
|
+
uint64_t timeout_millis;
|
|
109
|
+
} TemporalCoreClientKeepAliveOptions;
|
|
110
|
+
|
|
111
|
+
typedef struct TemporalCoreClientHttpConnectProxyOptions {
|
|
112
|
+
struct TemporalCoreByteArrayRef target_host;
|
|
113
|
+
struct TemporalCoreByteArrayRef username;
|
|
114
|
+
struct TemporalCoreByteArrayRef password;
|
|
115
|
+
} TemporalCoreClientHttpConnectProxyOptions;
|
|
116
|
+
|
|
117
|
+
typedef struct TemporalCoreClientOptions {
|
|
118
|
+
struct TemporalCoreByteArrayRef target_url;
|
|
119
|
+
struct TemporalCoreByteArrayRef client_name;
|
|
120
|
+
struct TemporalCoreByteArrayRef client_version;
|
|
121
|
+
TemporalCoreMetadataRef metadata;
|
|
122
|
+
struct TemporalCoreByteArrayRef api_key;
|
|
123
|
+
struct TemporalCoreByteArrayRef identity;
|
|
124
|
+
const struct TemporalCoreClientTlsOptions *tls_options;
|
|
125
|
+
const struct TemporalCoreClientRetryOptions *retry_options;
|
|
126
|
+
const struct TemporalCoreClientKeepAliveOptions *keep_alive_options;
|
|
127
|
+
const struct TemporalCoreClientHttpConnectProxyOptions *http_connect_proxy_options;
|
|
128
|
+
} TemporalCoreClientOptions;
|
|
129
|
+
|
|
130
|
+
typedef struct TemporalCoreByteArray {
|
|
131
|
+
const uint8_t *data;
|
|
132
|
+
size_t size;
|
|
133
|
+
/**
|
|
134
|
+
* For internal use only.
|
|
135
|
+
*/
|
|
136
|
+
size_t cap;
|
|
137
|
+
/**
|
|
138
|
+
* For internal use only.
|
|
139
|
+
*/
|
|
140
|
+
bool disable_free;
|
|
141
|
+
} TemporalCoreByteArray;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* If success or fail are not null, they must be manually freed when done.
|
|
145
|
+
*/
|
|
146
|
+
typedef void (*TemporalCoreClientConnectCallback)(void *user_data,
|
|
147
|
+
struct TemporalCoreClient *success,
|
|
148
|
+
const struct TemporalCoreByteArray *fail);
|
|
149
|
+
|
|
150
|
+
typedef struct TemporalCoreRpcCallOptions {
|
|
151
|
+
enum TemporalCoreRpcService service;
|
|
152
|
+
struct TemporalCoreByteArrayRef rpc;
|
|
153
|
+
struct TemporalCoreByteArrayRef req;
|
|
154
|
+
bool retry;
|
|
155
|
+
TemporalCoreMetadataRef metadata;
|
|
156
|
+
/**
|
|
157
|
+
* 0 means no timeout
|
|
158
|
+
*/
|
|
159
|
+
uint32_t timeout_millis;
|
|
160
|
+
const struct TemporalCoreCancellationToken *cancellation_token;
|
|
161
|
+
} TemporalCoreRpcCallOptions;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* If success or failure byte arrays inside fail are not null, they must be
|
|
165
|
+
* manually freed when done. Either success or failure_message are always
|
|
166
|
+
* present. Status code may still be 0 with a failure message. Failure details
|
|
167
|
+
* represent a protobuf gRPC status message.
|
|
168
|
+
*/
|
|
169
|
+
typedef void (*TemporalCoreClientRpcCallCallback)(void *user_data,
|
|
170
|
+
const struct TemporalCoreByteArray *success,
|
|
171
|
+
uint32_t status_code,
|
|
172
|
+
const struct TemporalCoreByteArray *failure_message,
|
|
173
|
+
const struct TemporalCoreByteArray *failure_details);
|
|
174
|
+
|
|
175
|
+
typedef union TemporalCoreMetricAttributeValue {
|
|
176
|
+
struct TemporalCoreByteArrayRef string_value;
|
|
177
|
+
int64_t int_value;
|
|
178
|
+
double float_value;
|
|
179
|
+
bool bool_value;
|
|
180
|
+
} TemporalCoreMetricAttributeValue;
|
|
181
|
+
|
|
182
|
+
typedef struct TemporalCoreMetricAttribute {
|
|
183
|
+
struct TemporalCoreByteArrayRef key;
|
|
184
|
+
union TemporalCoreMetricAttributeValue value;
|
|
185
|
+
enum TemporalCoreMetricAttributeValueType value_type;
|
|
186
|
+
} TemporalCoreMetricAttribute;
|
|
187
|
+
|
|
188
|
+
typedef struct TemporalCoreMetricOptions {
|
|
189
|
+
struct TemporalCoreByteArrayRef name;
|
|
190
|
+
struct TemporalCoreByteArrayRef description;
|
|
191
|
+
struct TemporalCoreByteArrayRef unit;
|
|
192
|
+
enum TemporalCoreMetricKind kind;
|
|
193
|
+
} TemporalCoreMetricOptions;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* If fail is not null, it must be manually freed when done. Runtime is always
|
|
197
|
+
* present, but it should never be used if fail is present, only freed after
|
|
198
|
+
* fail is freed using it.
|
|
199
|
+
*/
|
|
200
|
+
typedef struct TemporalCoreRuntimeOrFail {
|
|
201
|
+
struct TemporalCoreRuntime *runtime;
|
|
202
|
+
const struct TemporalCoreByteArray *fail;
|
|
203
|
+
} TemporalCoreRuntimeOrFail;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Operations on the log can only occur within the callback, it is freed
|
|
207
|
+
* immediately thereafter.
|
|
208
|
+
*/
|
|
209
|
+
typedef void (*TemporalCoreForwardedLogCallback)(enum TemporalCoreForwardedLogLevel level,
|
|
210
|
+
const struct TemporalCoreForwardedLog *log);
|
|
211
|
+
|
|
212
|
+
typedef struct TemporalCoreLoggingOptions {
|
|
213
|
+
struct TemporalCoreByteArrayRef filter;
|
|
214
|
+
/**
|
|
215
|
+
* This callback is expected to work for the life of the runtime.
|
|
216
|
+
*/
|
|
217
|
+
TemporalCoreForwardedLogCallback forward_to;
|
|
218
|
+
} TemporalCoreLoggingOptions;
|
|
219
|
+
|
|
220
|
+
typedef struct TemporalCoreOpenTelemetryOptions {
|
|
221
|
+
struct TemporalCoreByteArrayRef url;
|
|
222
|
+
TemporalCoreMetadataRef headers;
|
|
223
|
+
uint32_t metric_periodicity_millis;
|
|
224
|
+
enum TemporalCoreOpenTelemetryMetricTemporality metric_temporality;
|
|
225
|
+
bool durations_as_seconds;
|
|
226
|
+
enum TemporalCoreOpenTelemetryProtocol protocol;
|
|
227
|
+
/**
|
|
228
|
+
* Histogram bucket overrides in form of
|
|
229
|
+
* <metric1>\n<float>,<float>,<float>\n<metric2>\n<float>,<float>,<float>
|
|
230
|
+
*/
|
|
231
|
+
TemporalCoreMetadataRef histogram_bucket_overrides;
|
|
232
|
+
} TemporalCoreOpenTelemetryOptions;
|
|
233
|
+
|
|
234
|
+
typedef struct TemporalCorePrometheusOptions {
|
|
235
|
+
struct TemporalCoreByteArrayRef bind_address;
|
|
236
|
+
bool counters_total_suffix;
|
|
237
|
+
bool unit_suffix;
|
|
238
|
+
bool durations_as_seconds;
|
|
239
|
+
/**
|
|
240
|
+
* Histogram bucket overrides in form of
|
|
241
|
+
* <metric1>\n<float>,<float>,<float>\n<metric2>\n<float>,<float>,<float>
|
|
242
|
+
*/
|
|
243
|
+
TemporalCoreMetadataRef histogram_bucket_overrides;
|
|
244
|
+
} TemporalCorePrometheusOptions;
|
|
245
|
+
|
|
246
|
+
typedef const void *(*TemporalCoreCustomMetricMeterMetricNewCallback)(struct TemporalCoreByteArrayRef name,
|
|
247
|
+
struct TemporalCoreByteArrayRef description,
|
|
248
|
+
struct TemporalCoreByteArrayRef unit,
|
|
249
|
+
enum TemporalCoreMetricKind kind);
|
|
250
|
+
|
|
251
|
+
typedef void (*TemporalCoreCustomMetricMeterMetricFreeCallback)(const void *metric);
|
|
252
|
+
|
|
253
|
+
typedef void (*TemporalCoreCustomMetricMeterMetricRecordIntegerCallback)(const void *metric,
|
|
254
|
+
uint64_t value,
|
|
255
|
+
const void *attributes);
|
|
256
|
+
|
|
257
|
+
typedef void (*TemporalCoreCustomMetricMeterMetricRecordFloatCallback)(const void *metric,
|
|
258
|
+
double value,
|
|
259
|
+
const void *attributes);
|
|
260
|
+
|
|
261
|
+
typedef void (*TemporalCoreCustomMetricMeterMetricRecordDurationCallback)(const void *metric,
|
|
262
|
+
uint64_t value_ms,
|
|
263
|
+
const void *attributes);
|
|
264
|
+
|
|
265
|
+
typedef struct TemporalCoreCustomMetricAttributeValueString {
|
|
266
|
+
const uint8_t *data;
|
|
267
|
+
size_t size;
|
|
268
|
+
} TemporalCoreCustomMetricAttributeValueString;
|
|
269
|
+
|
|
270
|
+
typedef union TemporalCoreCustomMetricAttributeValue {
|
|
271
|
+
struct TemporalCoreCustomMetricAttributeValueString string_value;
|
|
272
|
+
int64_t int_value;
|
|
273
|
+
double float_value;
|
|
274
|
+
bool bool_value;
|
|
275
|
+
} TemporalCoreCustomMetricAttributeValue;
|
|
276
|
+
|
|
277
|
+
typedef struct TemporalCoreCustomMetricAttribute {
|
|
278
|
+
struct TemporalCoreByteArrayRef key;
|
|
279
|
+
union TemporalCoreCustomMetricAttributeValue value;
|
|
280
|
+
enum TemporalCoreMetricAttributeValueType value_type;
|
|
281
|
+
} TemporalCoreCustomMetricAttribute;
|
|
282
|
+
|
|
283
|
+
typedef const void *(*TemporalCoreCustomMetricMeterAttributesNewCallback)(const void *append_from,
|
|
284
|
+
const struct TemporalCoreCustomMetricAttribute *attributes,
|
|
285
|
+
size_t attributes_size);
|
|
286
|
+
|
|
287
|
+
typedef void (*TemporalCoreCustomMetricMeterAttributesFreeCallback)(const void *attributes);
|
|
288
|
+
|
|
289
|
+
typedef void (*TemporalCoreCustomMetricMeterMeterFreeCallback)(const struct TemporalCoreCustomMetricMeter *meter);
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* No parameters in the callbacks below should be assumed to live beyond the
|
|
293
|
+
* callbacks unless they are pointers to things that were created lang-side
|
|
294
|
+
* originally. There are no guarantees on which thread these calls may be
|
|
295
|
+
* invoked on.
|
|
296
|
+
*
|
|
297
|
+
* Attribute pointers may be null when recording if no attributes are associated with the metric.
|
|
298
|
+
*/
|
|
299
|
+
typedef struct TemporalCoreCustomMetricMeter {
|
|
300
|
+
TemporalCoreCustomMetricMeterMetricNewCallback metric_new;
|
|
301
|
+
TemporalCoreCustomMetricMeterMetricFreeCallback metric_free;
|
|
302
|
+
TemporalCoreCustomMetricMeterMetricRecordIntegerCallback metric_record_integer;
|
|
303
|
+
TemporalCoreCustomMetricMeterMetricRecordFloatCallback metric_record_float;
|
|
304
|
+
TemporalCoreCustomMetricMeterMetricRecordDurationCallback metric_record_duration;
|
|
305
|
+
TemporalCoreCustomMetricMeterAttributesNewCallback attributes_new;
|
|
306
|
+
TemporalCoreCustomMetricMeterAttributesFreeCallback attributes_free;
|
|
307
|
+
TemporalCoreCustomMetricMeterMeterFreeCallback meter_free;
|
|
308
|
+
} TemporalCoreCustomMetricMeter;
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Only one of opentelemetry, prometheus, or custom_meter can be present.
|
|
312
|
+
*/
|
|
313
|
+
typedef struct TemporalCoreMetricsOptions {
|
|
314
|
+
const struct TemporalCoreOpenTelemetryOptions *opentelemetry;
|
|
315
|
+
const struct TemporalCorePrometheusOptions *prometheus;
|
|
316
|
+
/**
|
|
317
|
+
* If present, this is freed by a callback within itself
|
|
318
|
+
*/
|
|
319
|
+
const struct TemporalCoreCustomMetricMeter *custom_meter;
|
|
320
|
+
bool attach_service_name;
|
|
321
|
+
TemporalCoreMetadataRef global_tags;
|
|
322
|
+
struct TemporalCoreByteArrayRef metric_prefix;
|
|
323
|
+
} TemporalCoreMetricsOptions;
|
|
324
|
+
|
|
325
|
+
typedef struct TemporalCoreTelemetryOptions {
|
|
326
|
+
const struct TemporalCoreLoggingOptions *logging;
|
|
327
|
+
const struct TemporalCoreMetricsOptions *metrics;
|
|
328
|
+
} TemporalCoreTelemetryOptions;
|
|
329
|
+
|
|
330
|
+
typedef struct TemporalCoreRuntimeOptions {
|
|
331
|
+
const struct TemporalCoreTelemetryOptions *telemetry;
|
|
332
|
+
} TemporalCoreRuntimeOptions;
|
|
333
|
+
|
|
334
|
+
typedef struct TemporalCoreTestServerOptions {
|
|
335
|
+
/**
|
|
336
|
+
* Empty means default behavior
|
|
337
|
+
*/
|
|
338
|
+
struct TemporalCoreByteArrayRef existing_path;
|
|
339
|
+
struct TemporalCoreByteArrayRef sdk_name;
|
|
340
|
+
struct TemporalCoreByteArrayRef sdk_version;
|
|
341
|
+
struct TemporalCoreByteArrayRef download_version;
|
|
342
|
+
/**
|
|
343
|
+
* Empty means default behavior
|
|
344
|
+
*/
|
|
345
|
+
struct TemporalCoreByteArrayRef download_dest_dir;
|
|
346
|
+
/**
|
|
347
|
+
* 0 means default behavior
|
|
348
|
+
*/
|
|
349
|
+
uint16_t port;
|
|
350
|
+
/**
|
|
351
|
+
* Newline delimited
|
|
352
|
+
*/
|
|
353
|
+
struct TemporalCoreByteArrayRef extra_args;
|
|
354
|
+
/**
|
|
355
|
+
* 0 means no TTL
|
|
356
|
+
*/
|
|
357
|
+
uint64_t download_ttl_seconds;
|
|
358
|
+
} TemporalCoreTestServerOptions;
|
|
359
|
+
|
|
360
|
+
typedef struct TemporalCoreDevServerOptions {
|
|
361
|
+
/**
|
|
362
|
+
* Must always be present
|
|
363
|
+
*/
|
|
364
|
+
const struct TemporalCoreTestServerOptions *test_server;
|
|
365
|
+
struct TemporalCoreByteArrayRef namespace_;
|
|
366
|
+
struct TemporalCoreByteArrayRef ip;
|
|
367
|
+
/**
|
|
368
|
+
* Empty means default behavior
|
|
369
|
+
*/
|
|
370
|
+
struct TemporalCoreByteArrayRef database_filename;
|
|
371
|
+
bool ui;
|
|
372
|
+
uint16_t ui_port;
|
|
373
|
+
struct TemporalCoreByteArrayRef log_format;
|
|
374
|
+
struct TemporalCoreByteArrayRef log_level;
|
|
375
|
+
} TemporalCoreDevServerOptions;
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Anything besides user data must be freed if non-null.
|
|
379
|
+
*/
|
|
380
|
+
typedef void (*TemporalCoreEphemeralServerStartCallback)(void *user_data,
|
|
381
|
+
struct TemporalCoreEphemeralServer *success,
|
|
382
|
+
const struct TemporalCoreByteArray *success_target,
|
|
383
|
+
const struct TemporalCoreByteArray *fail);
|
|
384
|
+
|
|
385
|
+
typedef void (*TemporalCoreEphemeralServerShutdownCallback)(void *user_data,
|
|
386
|
+
const struct TemporalCoreByteArray *fail);
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Only runtime or fail will be non-null. Whichever is must be freed when done.
|
|
390
|
+
*/
|
|
391
|
+
typedef struct TemporalCoreWorkerOrFail {
|
|
392
|
+
struct TemporalCoreWorker *worker;
|
|
393
|
+
const struct TemporalCoreByteArray *fail;
|
|
394
|
+
} TemporalCoreWorkerOrFail;
|
|
395
|
+
|
|
396
|
+
typedef struct TemporalCoreWorkerVersioningNone {
|
|
397
|
+
struct TemporalCoreByteArrayRef build_id;
|
|
398
|
+
} TemporalCoreWorkerVersioningNone;
|
|
399
|
+
|
|
400
|
+
typedef struct TemporalCoreWorkerDeploymentVersion {
|
|
401
|
+
struct TemporalCoreByteArrayRef deployment_name;
|
|
402
|
+
struct TemporalCoreByteArrayRef build_id;
|
|
403
|
+
} TemporalCoreWorkerDeploymentVersion;
|
|
404
|
+
|
|
405
|
+
typedef struct TemporalCoreWorkerDeploymentOptions {
|
|
406
|
+
struct TemporalCoreWorkerDeploymentVersion version;
|
|
407
|
+
bool use_worker_versioning;
|
|
408
|
+
int32_t default_versioning_behavior;
|
|
409
|
+
} TemporalCoreWorkerDeploymentOptions;
|
|
410
|
+
|
|
411
|
+
typedef struct TemporalCoreLegacyBuildIdBasedStrategy {
|
|
412
|
+
struct TemporalCoreByteArrayRef build_id;
|
|
413
|
+
} TemporalCoreLegacyBuildIdBasedStrategy;
|
|
414
|
+
|
|
415
|
+
typedef enum TemporalCoreWorkerVersioningStrategy_Tag {
|
|
416
|
+
None,
|
|
417
|
+
DeploymentBased,
|
|
418
|
+
LegacyBuildIdBased,
|
|
419
|
+
} TemporalCoreWorkerVersioningStrategy_Tag;
|
|
420
|
+
|
|
421
|
+
typedef struct TemporalCoreWorkerVersioningStrategy {
|
|
422
|
+
TemporalCoreWorkerVersioningStrategy_Tag tag;
|
|
423
|
+
union {
|
|
424
|
+
struct {
|
|
425
|
+
struct TemporalCoreWorkerVersioningNone none;
|
|
426
|
+
};
|
|
427
|
+
struct {
|
|
428
|
+
struct TemporalCoreWorkerDeploymentOptions deployment_based;
|
|
429
|
+
};
|
|
430
|
+
struct {
|
|
431
|
+
struct TemporalCoreLegacyBuildIdBasedStrategy legacy_build_id_based;
|
|
432
|
+
};
|
|
433
|
+
};
|
|
434
|
+
} TemporalCoreWorkerVersioningStrategy;
|
|
435
|
+
|
|
436
|
+
typedef struct TemporalCoreFixedSizeSlotSupplier {
|
|
437
|
+
uintptr_t num_slots;
|
|
438
|
+
} TemporalCoreFixedSizeSlotSupplier;
|
|
439
|
+
|
|
440
|
+
typedef struct TemporalCoreResourceBasedTunerOptions {
|
|
441
|
+
double target_memory_usage;
|
|
442
|
+
double target_cpu_usage;
|
|
443
|
+
} TemporalCoreResourceBasedTunerOptions;
|
|
444
|
+
|
|
445
|
+
typedef struct TemporalCoreResourceBasedSlotSupplier {
|
|
446
|
+
uintptr_t minimum_slots;
|
|
447
|
+
uintptr_t maximum_slots;
|
|
448
|
+
uint64_t ramp_throttle_ms;
|
|
449
|
+
struct TemporalCoreResourceBasedTunerOptions tuner_options;
|
|
450
|
+
} TemporalCoreResourceBasedSlotSupplier;
|
|
451
|
+
|
|
452
|
+
typedef struct TemporalCoreSlotReserveCtx {
|
|
453
|
+
enum TemporalCoreSlotKindType slot_type;
|
|
454
|
+
struct TemporalCoreByteArrayRef task_queue;
|
|
455
|
+
struct TemporalCoreByteArrayRef worker_identity;
|
|
456
|
+
struct TemporalCoreByteArrayRef worker_build_id;
|
|
457
|
+
bool is_sticky;
|
|
458
|
+
void *token_src;
|
|
459
|
+
} TemporalCoreSlotReserveCtx;
|
|
460
|
+
|
|
461
|
+
typedef void (*TemporalCoreCustomReserveSlotCallback)(const struct TemporalCoreSlotReserveCtx *ctx,
|
|
462
|
+
void *sender);
|
|
463
|
+
|
|
464
|
+
typedef void (*TemporalCoreCustomCancelReserveCallback)(void *token_source);
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* Must return C#-tracked id for the permit. A zero value means no permit was reserved.
|
|
468
|
+
*/
|
|
469
|
+
typedef uintptr_t (*TemporalCoreCustomTryReserveSlotCallback)(const struct TemporalCoreSlotReserveCtx *ctx);
|
|
470
|
+
|
|
471
|
+
typedef enum TemporalCoreSlotInfo_Tag {
|
|
472
|
+
WorkflowSlotInfo,
|
|
473
|
+
ActivitySlotInfo,
|
|
474
|
+
LocalActivitySlotInfo,
|
|
475
|
+
NexusSlotInfo,
|
|
476
|
+
} TemporalCoreSlotInfo_Tag;
|
|
477
|
+
|
|
478
|
+
typedef struct TemporalCoreWorkflowSlotInfo_Body {
|
|
479
|
+
struct TemporalCoreByteArrayRef workflow_type;
|
|
480
|
+
bool is_sticky;
|
|
481
|
+
} TemporalCoreWorkflowSlotInfo_Body;
|
|
482
|
+
|
|
483
|
+
typedef struct TemporalCoreActivitySlotInfo_Body {
|
|
484
|
+
struct TemporalCoreByteArrayRef activity_type;
|
|
485
|
+
} TemporalCoreActivitySlotInfo_Body;
|
|
486
|
+
|
|
487
|
+
typedef struct TemporalCoreLocalActivitySlotInfo_Body {
|
|
488
|
+
struct TemporalCoreByteArrayRef activity_type;
|
|
489
|
+
} TemporalCoreLocalActivitySlotInfo_Body;
|
|
490
|
+
|
|
491
|
+
typedef struct TemporalCoreNexusSlotInfo_Body {
|
|
492
|
+
struct TemporalCoreByteArrayRef operation;
|
|
493
|
+
struct TemporalCoreByteArrayRef service;
|
|
494
|
+
} TemporalCoreNexusSlotInfo_Body;
|
|
495
|
+
|
|
496
|
+
typedef struct TemporalCoreSlotInfo {
|
|
497
|
+
TemporalCoreSlotInfo_Tag tag;
|
|
498
|
+
union {
|
|
499
|
+
TemporalCoreWorkflowSlotInfo_Body workflow_slot_info;
|
|
500
|
+
TemporalCoreActivitySlotInfo_Body activity_slot_info;
|
|
501
|
+
TemporalCoreLocalActivitySlotInfo_Body local_activity_slot_info;
|
|
502
|
+
TemporalCoreNexusSlotInfo_Body nexus_slot_info;
|
|
503
|
+
};
|
|
504
|
+
} TemporalCoreSlotInfo;
|
|
505
|
+
|
|
506
|
+
typedef struct TemporalCoreSlotMarkUsedCtx {
|
|
507
|
+
struct TemporalCoreSlotInfo slot_info;
|
|
508
|
+
/**
|
|
509
|
+
* C# id for the slot permit.
|
|
510
|
+
*/
|
|
511
|
+
uintptr_t slot_permit;
|
|
512
|
+
} TemporalCoreSlotMarkUsedCtx;
|
|
513
|
+
|
|
514
|
+
typedef void (*TemporalCoreCustomMarkSlotUsedCallback)(const struct TemporalCoreSlotMarkUsedCtx *ctx);
|
|
515
|
+
|
|
516
|
+
typedef struct TemporalCoreSlotReleaseCtx {
|
|
517
|
+
const struct TemporalCoreSlotInfo *slot_info;
|
|
518
|
+
/**
|
|
519
|
+
* C# id for the slot permit.
|
|
520
|
+
*/
|
|
521
|
+
uintptr_t slot_permit;
|
|
522
|
+
} TemporalCoreSlotReleaseCtx;
|
|
523
|
+
|
|
524
|
+
typedef void (*TemporalCoreCustomReleaseSlotCallback)(const struct TemporalCoreSlotReleaseCtx *ctx);
|
|
525
|
+
|
|
526
|
+
typedef void (*TemporalCoreCustomSlotImplFreeCallback)(const struct TemporalCoreCustomSlotSupplierCallbacks *userimpl);
|
|
527
|
+
|
|
528
|
+
typedef struct TemporalCoreCustomSlotSupplierCallbacks {
|
|
529
|
+
TemporalCoreCustomReserveSlotCallback reserve;
|
|
530
|
+
TemporalCoreCustomCancelReserveCallback cancel_reserve;
|
|
531
|
+
TemporalCoreCustomTryReserveSlotCallback try_reserve;
|
|
532
|
+
TemporalCoreCustomMarkSlotUsedCallback mark_used;
|
|
533
|
+
TemporalCoreCustomReleaseSlotCallback release;
|
|
534
|
+
TemporalCoreCustomSlotImplFreeCallback free;
|
|
535
|
+
} TemporalCoreCustomSlotSupplierCallbacks;
|
|
536
|
+
|
|
537
|
+
typedef struct TemporalCoreCustomSlotSupplierCallbacksImpl {
|
|
538
|
+
const struct TemporalCoreCustomSlotSupplierCallbacks *_0;
|
|
539
|
+
} TemporalCoreCustomSlotSupplierCallbacksImpl;
|
|
540
|
+
|
|
541
|
+
typedef enum TemporalCoreSlotSupplier_Tag {
|
|
542
|
+
FixedSize,
|
|
543
|
+
ResourceBased,
|
|
544
|
+
Custom,
|
|
545
|
+
} TemporalCoreSlotSupplier_Tag;
|
|
546
|
+
|
|
547
|
+
typedef struct TemporalCoreSlotSupplier {
|
|
548
|
+
TemporalCoreSlotSupplier_Tag tag;
|
|
549
|
+
union {
|
|
550
|
+
struct {
|
|
551
|
+
struct TemporalCoreFixedSizeSlotSupplier fixed_size;
|
|
552
|
+
};
|
|
553
|
+
struct {
|
|
554
|
+
struct TemporalCoreResourceBasedSlotSupplier resource_based;
|
|
555
|
+
};
|
|
556
|
+
struct {
|
|
557
|
+
struct TemporalCoreCustomSlotSupplierCallbacksImpl custom;
|
|
558
|
+
};
|
|
559
|
+
};
|
|
560
|
+
} TemporalCoreSlotSupplier;
|
|
561
|
+
|
|
562
|
+
typedef struct TemporalCoreTunerHolder {
|
|
563
|
+
struct TemporalCoreSlotSupplier workflow_slot_supplier;
|
|
564
|
+
struct TemporalCoreSlotSupplier activity_slot_supplier;
|
|
565
|
+
struct TemporalCoreSlotSupplier local_activity_slot_supplier;
|
|
566
|
+
} TemporalCoreTunerHolder;
|
|
567
|
+
|
|
568
|
+
typedef struct TemporalCorePollerBehaviorSimpleMaximum {
|
|
569
|
+
uintptr_t simple_maximum;
|
|
570
|
+
} TemporalCorePollerBehaviorSimpleMaximum;
|
|
571
|
+
|
|
572
|
+
typedef struct TemporalCorePollerBehaviorAutoscaling {
|
|
573
|
+
uintptr_t minimum;
|
|
574
|
+
uintptr_t maximum;
|
|
575
|
+
uintptr_t initial;
|
|
576
|
+
} TemporalCorePollerBehaviorAutoscaling;
|
|
577
|
+
|
|
578
|
+
typedef struct TemporalCorePollerBehavior {
|
|
579
|
+
const struct TemporalCorePollerBehaviorSimpleMaximum *simple_maximum;
|
|
580
|
+
const struct TemporalCorePollerBehaviorAutoscaling *autoscaling;
|
|
581
|
+
} TemporalCorePollerBehavior;
|
|
582
|
+
|
|
583
|
+
typedef struct TemporalCoreByteArrayRefArray {
|
|
584
|
+
const struct TemporalCoreByteArrayRef *data;
|
|
585
|
+
size_t size;
|
|
586
|
+
} TemporalCoreByteArrayRefArray;
|
|
587
|
+
|
|
588
|
+
typedef struct TemporalCoreWorkerOptions {
|
|
589
|
+
struct TemporalCoreByteArrayRef namespace_;
|
|
590
|
+
struct TemporalCoreByteArrayRef task_queue;
|
|
591
|
+
struct TemporalCoreWorkerVersioningStrategy versioning_strategy;
|
|
592
|
+
struct TemporalCoreByteArrayRef identity_override;
|
|
593
|
+
uint32_t max_cached_workflows;
|
|
594
|
+
struct TemporalCoreTunerHolder tuner;
|
|
595
|
+
bool no_remote_activities;
|
|
596
|
+
uint64_t sticky_queue_schedule_to_start_timeout_millis;
|
|
597
|
+
uint64_t max_heartbeat_throttle_interval_millis;
|
|
598
|
+
uint64_t default_heartbeat_throttle_interval_millis;
|
|
599
|
+
double max_activities_per_second;
|
|
600
|
+
double max_task_queue_activities_per_second;
|
|
601
|
+
uint64_t graceful_shutdown_period_millis;
|
|
602
|
+
struct TemporalCorePollerBehavior workflow_task_poller_behavior;
|
|
603
|
+
float nonsticky_to_sticky_poll_ratio;
|
|
604
|
+
struct TemporalCorePollerBehavior activity_task_poller_behavior;
|
|
605
|
+
bool nondeterminism_as_workflow_fail;
|
|
606
|
+
struct TemporalCoreByteArrayRefArray nondeterminism_as_workflow_fail_for_types;
|
|
607
|
+
} TemporalCoreWorkerOptions;
|
|
608
|
+
|
|
609
|
+
/**
|
|
610
|
+
* If fail is present, it must be freed.
|
|
611
|
+
*/
|
|
612
|
+
typedef void (*TemporalCoreWorkerCallback)(void *user_data, const struct TemporalCoreByteArray *fail);
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* If success or fail are present, they must be freed. They will both be null
|
|
616
|
+
* if this is a result of a poll shutdown.
|
|
617
|
+
*/
|
|
618
|
+
typedef void (*TemporalCoreWorkerPollCallback)(void *user_data,
|
|
619
|
+
const struct TemporalCoreByteArray *success,
|
|
620
|
+
const struct TemporalCoreByteArray *fail);
|
|
621
|
+
|
|
622
|
+
typedef struct TemporalCoreWorkerReplayerOrFail {
|
|
623
|
+
struct TemporalCoreWorker *worker;
|
|
624
|
+
struct TemporalCoreWorkerReplayPusher *worker_replay_pusher;
|
|
625
|
+
const struct TemporalCoreByteArray *fail;
|
|
626
|
+
} TemporalCoreWorkerReplayerOrFail;
|
|
627
|
+
|
|
628
|
+
typedef struct TemporalCoreWorkerReplayPushResult {
|
|
629
|
+
const struct TemporalCoreByteArray *fail;
|
|
630
|
+
} TemporalCoreWorkerReplayPushResult;
|
|
631
|
+
|
|
632
|
+
#ifdef __cplusplus
|
|
633
|
+
extern "C" {
|
|
634
|
+
#endif // __cplusplus
|
|
635
|
+
|
|
636
|
+
struct TemporalCoreCancellationToken *temporal_core_cancellation_token_new(void);
|
|
637
|
+
|
|
638
|
+
void temporal_core_cancellation_token_cancel(struct TemporalCoreCancellationToken *token);
|
|
639
|
+
|
|
640
|
+
void temporal_core_cancellation_token_free(struct TemporalCoreCancellationToken *token);
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* Runtime must live as long as client. Options and user data must live through
|
|
644
|
+
* callback.
|
|
645
|
+
*/
|
|
646
|
+
void temporal_core_client_connect(struct TemporalCoreRuntime *runtime,
|
|
647
|
+
const struct TemporalCoreClientOptions *options,
|
|
648
|
+
void *user_data,
|
|
649
|
+
TemporalCoreClientConnectCallback callback);
|
|
650
|
+
|
|
651
|
+
void temporal_core_client_free(struct TemporalCoreClient *client);
|
|
652
|
+
|
|
653
|
+
void temporal_core_client_update_metadata(struct TemporalCoreClient *client,
|
|
654
|
+
struct TemporalCoreByteArrayRef metadata);
|
|
655
|
+
|
|
656
|
+
void temporal_core_client_update_api_key(struct TemporalCoreClient *client,
|
|
657
|
+
struct TemporalCoreByteArrayRef api_key);
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* Client, options, and user data must live through callback.
|
|
661
|
+
*/
|
|
662
|
+
void temporal_core_client_rpc_call(struct TemporalCoreClient *client,
|
|
663
|
+
const struct TemporalCoreRpcCallOptions *options,
|
|
664
|
+
void *user_data,
|
|
665
|
+
TemporalCoreClientRpcCallCallback callback);
|
|
666
|
+
|
|
667
|
+
struct TemporalCoreMetricMeter *temporal_core_metric_meter_new(struct TemporalCoreRuntime *runtime);
|
|
668
|
+
|
|
669
|
+
void temporal_core_metric_meter_free(struct TemporalCoreMetricMeter *meter);
|
|
670
|
+
|
|
671
|
+
struct TemporalCoreMetricAttributes *temporal_core_metric_attributes_new(const struct TemporalCoreMetricMeter *meter,
|
|
672
|
+
const struct TemporalCoreMetricAttribute *attrs,
|
|
673
|
+
size_t size);
|
|
674
|
+
|
|
675
|
+
struct TemporalCoreMetricAttributes *temporal_core_metric_attributes_new_append(const struct TemporalCoreMetricMeter *meter,
|
|
676
|
+
const struct TemporalCoreMetricAttributes *orig,
|
|
677
|
+
const struct TemporalCoreMetricAttribute *attrs,
|
|
678
|
+
size_t size);
|
|
679
|
+
|
|
680
|
+
void temporal_core_metric_attributes_free(struct TemporalCoreMetricAttributes *attrs);
|
|
681
|
+
|
|
682
|
+
struct TemporalCoreMetric *temporal_core_metric_new(const struct TemporalCoreMetricMeter *meter,
|
|
683
|
+
const struct TemporalCoreMetricOptions *options);
|
|
684
|
+
|
|
685
|
+
void temporal_core_metric_free(struct TemporalCoreMetric *metric);
|
|
686
|
+
|
|
687
|
+
void temporal_core_metric_record_integer(const struct TemporalCoreMetric *metric,
|
|
688
|
+
uint64_t value,
|
|
689
|
+
const struct TemporalCoreMetricAttributes *attrs);
|
|
690
|
+
|
|
691
|
+
void temporal_core_metric_record_float(const struct TemporalCoreMetric *metric,
|
|
692
|
+
double value,
|
|
693
|
+
const struct TemporalCoreMetricAttributes *attrs);
|
|
694
|
+
|
|
695
|
+
void temporal_core_metric_record_duration(const struct TemporalCoreMetric *metric,
|
|
696
|
+
uint64_t value_ms,
|
|
697
|
+
const struct TemporalCoreMetricAttributes *attrs);
|
|
698
|
+
|
|
699
|
+
struct TemporalCoreRandom *temporal_core_random_new(uint64_t seed);
|
|
700
|
+
|
|
701
|
+
void temporal_core_random_free(struct TemporalCoreRandom *random);
|
|
702
|
+
|
|
703
|
+
int32_t temporal_core_random_int32_range(struct TemporalCoreRandom *random,
|
|
704
|
+
int32_t min,
|
|
705
|
+
int32_t max,
|
|
706
|
+
bool max_inclusive);
|
|
707
|
+
|
|
708
|
+
double temporal_core_random_double_range(struct TemporalCoreRandom *random,
|
|
709
|
+
double min,
|
|
710
|
+
double max,
|
|
711
|
+
bool max_inclusive);
|
|
712
|
+
|
|
713
|
+
void temporal_core_random_fill_bytes(struct TemporalCoreRandom *random,
|
|
714
|
+
struct TemporalCoreByteArrayRef bytes);
|
|
715
|
+
|
|
716
|
+
struct TemporalCoreRuntimeOrFail temporal_core_runtime_new(const struct TemporalCoreRuntimeOptions *options);
|
|
717
|
+
|
|
718
|
+
void temporal_core_runtime_free(struct TemporalCoreRuntime *runtime);
|
|
719
|
+
|
|
720
|
+
void temporal_core_byte_array_free(struct TemporalCoreRuntime *runtime,
|
|
721
|
+
const struct TemporalCoreByteArray *bytes);
|
|
722
|
+
|
|
723
|
+
struct TemporalCoreByteArrayRef temporal_core_forwarded_log_target(const struct TemporalCoreForwardedLog *log);
|
|
724
|
+
|
|
725
|
+
struct TemporalCoreByteArrayRef temporal_core_forwarded_log_message(const struct TemporalCoreForwardedLog *log);
|
|
726
|
+
|
|
727
|
+
uint64_t temporal_core_forwarded_log_timestamp_millis(const struct TemporalCoreForwardedLog *log);
|
|
728
|
+
|
|
729
|
+
struct TemporalCoreByteArrayRef temporal_core_forwarded_log_fields_json(const struct TemporalCoreForwardedLog *log);
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* Runtime must live as long as server. Options and user data must live through
|
|
733
|
+
* callback.
|
|
734
|
+
*/
|
|
735
|
+
void temporal_core_ephemeral_server_start_dev_server(struct TemporalCoreRuntime *runtime,
|
|
736
|
+
const struct TemporalCoreDevServerOptions *options,
|
|
737
|
+
void *user_data,
|
|
738
|
+
TemporalCoreEphemeralServerStartCallback callback);
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* Runtime must live as long as server. Options and user data must live through
|
|
742
|
+
* callback.
|
|
743
|
+
*/
|
|
744
|
+
void temporal_core_ephemeral_server_start_test_server(struct TemporalCoreRuntime *runtime,
|
|
745
|
+
const struct TemporalCoreTestServerOptions *options,
|
|
746
|
+
void *user_data,
|
|
747
|
+
TemporalCoreEphemeralServerStartCallback callback);
|
|
748
|
+
|
|
749
|
+
void temporal_core_ephemeral_server_free(struct TemporalCoreEphemeralServer *server);
|
|
750
|
+
|
|
751
|
+
void temporal_core_ephemeral_server_shutdown(struct TemporalCoreEphemeralServer *server,
|
|
752
|
+
void *user_data,
|
|
753
|
+
TemporalCoreEphemeralServerShutdownCallback callback);
|
|
754
|
+
|
|
755
|
+
struct TemporalCoreWorkerOrFail temporal_core_worker_new(struct TemporalCoreClient *client,
|
|
756
|
+
const struct TemporalCoreWorkerOptions *options);
|
|
757
|
+
|
|
758
|
+
void temporal_core_worker_free(struct TemporalCoreWorker *worker);
|
|
759
|
+
|
|
760
|
+
void temporal_core_worker_validate(struct TemporalCoreWorker *worker,
|
|
761
|
+
void *user_data,
|
|
762
|
+
TemporalCoreWorkerCallback callback);
|
|
763
|
+
|
|
764
|
+
void temporal_core_worker_replace_client(struct TemporalCoreWorker *worker,
|
|
765
|
+
struct TemporalCoreClient *new_client);
|
|
766
|
+
|
|
767
|
+
void temporal_core_worker_poll_workflow_activation(struct TemporalCoreWorker *worker,
|
|
768
|
+
void *user_data,
|
|
769
|
+
TemporalCoreWorkerPollCallback callback);
|
|
770
|
+
|
|
771
|
+
void temporal_core_worker_poll_activity_task(struct TemporalCoreWorker *worker,
|
|
772
|
+
void *user_data,
|
|
773
|
+
TemporalCoreWorkerPollCallback callback);
|
|
774
|
+
|
|
775
|
+
void temporal_core_worker_complete_workflow_activation(struct TemporalCoreWorker *worker,
|
|
776
|
+
struct TemporalCoreByteArrayRef completion,
|
|
777
|
+
void *user_data,
|
|
778
|
+
TemporalCoreWorkerCallback callback);
|
|
779
|
+
|
|
780
|
+
void temporal_core_worker_complete_activity_task(struct TemporalCoreWorker *worker,
|
|
781
|
+
struct TemporalCoreByteArrayRef completion,
|
|
782
|
+
void *user_data,
|
|
783
|
+
TemporalCoreWorkerCallback callback);
|
|
784
|
+
|
|
785
|
+
/**
|
|
786
|
+
* Returns error if any. Must be freed if returned.
|
|
787
|
+
*/
|
|
788
|
+
const struct TemporalCoreByteArray *temporal_core_worker_record_activity_heartbeat(struct TemporalCoreWorker *worker,
|
|
789
|
+
struct TemporalCoreByteArrayRef heartbeat);
|
|
790
|
+
|
|
791
|
+
void temporal_core_worker_request_workflow_eviction(struct TemporalCoreWorker *worker,
|
|
792
|
+
struct TemporalCoreByteArrayRef run_id);
|
|
793
|
+
|
|
794
|
+
void temporal_core_worker_initiate_shutdown(struct TemporalCoreWorker *worker);
|
|
795
|
+
|
|
796
|
+
void temporal_core_worker_finalize_shutdown(struct TemporalCoreWorker *worker,
|
|
797
|
+
void *user_data,
|
|
798
|
+
TemporalCoreWorkerCallback callback);
|
|
799
|
+
|
|
800
|
+
struct TemporalCoreWorkerReplayerOrFail temporal_core_worker_replayer_new(struct TemporalCoreRuntime *runtime,
|
|
801
|
+
const struct TemporalCoreWorkerOptions *options);
|
|
802
|
+
|
|
803
|
+
void temporal_core_worker_replay_pusher_free(struct TemporalCoreWorkerReplayPusher *worker_replay_pusher);
|
|
804
|
+
|
|
805
|
+
struct TemporalCoreWorkerReplayPushResult temporal_core_worker_replay_push(struct TemporalCoreWorker *worker,
|
|
806
|
+
struct TemporalCoreWorkerReplayPusher *worker_replay_pusher,
|
|
807
|
+
struct TemporalCoreByteArrayRef workflow_id,
|
|
808
|
+
struct TemporalCoreByteArrayRef history);
|
|
809
|
+
|
|
810
|
+
void temporal_core_complete_async_reserve(void *sender, uintptr_t permit_id);
|
|
811
|
+
|
|
812
|
+
void temporal_core_set_reserve_cancel_target(struct TemporalCoreSlotReserveCtx *ctx,
|
|
813
|
+
void *token_ptr);
|
|
814
|
+
|
|
815
|
+
#ifdef __cplusplus
|
|
816
|
+
} // extern "C"
|
|
817
|
+
#endif // __cplusplus
|