@temporalio/core-bridge 1.1.0 → 1.4.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 +765 -128
- package/Cargo.toml +2 -2
- package/common.js +7 -3
- package/index.d.ts +118 -5
- package/index.js +2 -6
- package/package.json +2 -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/scripts/build.js +4 -3
- package/sdk-core/.buildkite/docker/Dockerfile +2 -1
- package/sdk-core/.buildkite/pipeline.yml +2 -0
- package/sdk-core/.cargo/config.toml +1 -1
- package/sdk-core/ARCHITECTURE.md +2 -2
- package/sdk-core/README.md +12 -0
- package/sdk-core/bridge-ffi/Cargo.toml +2 -2
- package/sdk-core/bridge-ffi/src/lib.rs +2 -2
- package/sdk-core/client/Cargo.toml +7 -5
- package/sdk-core/client/src/lib.rs +354 -226
- package/sdk-core/client/src/metrics.rs +13 -11
- package/sdk-core/client/src/raw.rs +352 -107
- package/sdk-core/client/src/retry.rs +188 -147
- package/sdk-core/client/src/workflow_handle/mod.rs +1 -1
- package/sdk-core/core/Cargo.toml +28 -15
- package/sdk-core/core/src/core_tests/activity_tasks.rs +98 -33
- package/sdk-core/core/src/core_tests/child_workflows.rs +125 -3
- package/sdk-core/core/src/core_tests/local_activities.rs +6 -6
- package/sdk-core/core/src/core_tests/workers.rs +3 -2
- package/sdk-core/core/src/core_tests/workflow_tasks.rs +70 -2
- package/sdk-core/core/src/ephemeral_server/mod.rs +515 -0
- package/sdk-core/core/src/lib.rs +62 -28
- package/sdk-core/core/src/pollers/mod.rs +2 -0
- package/sdk-core/core/src/pollers/poll_buffer.rs +4 -4
- package/sdk-core/core/src/replay/mod.rs +3 -3
- package/sdk-core/core/src/retry_logic.rs +10 -9
- package/sdk-core/core/src/telemetry/metrics.rs +48 -39
- package/sdk-core/core/src/telemetry/mod.rs +46 -12
- package/sdk-core/core/src/telemetry/prometheus_server.rs +17 -13
- package/sdk-core/core/src/test_help/mod.rs +18 -8
- package/sdk-core/core/src/worker/activities/activity_heartbeat_manager.rs +10 -10
- package/sdk-core/core/src/worker/activities/local_activities.rs +13 -13
- package/sdk-core/core/src/worker/activities.rs +6 -12
- package/sdk-core/core/src/worker/client/mocks.rs +1 -0
- package/sdk-core/core/src/worker/client.rs +193 -64
- package/sdk-core/core/src/worker/mod.rs +14 -19
- package/sdk-core/core/src/worker/workflow/driven_workflow.rs +3 -0
- package/sdk-core/core/src/worker/workflow/history_update.rs +5 -5
- package/sdk-core/core/src/worker/workflow/machines/child_workflow_state_machine.rs +133 -85
- package/sdk-core/core/src/worker/workflow/machines/mod.rs +3 -2
- package/sdk-core/core/src/worker/workflow/machines/workflow_machines.rs +160 -105
- package/sdk-core/core/src/worker/workflow/managed_run.rs +2 -1
- package/sdk-core/core/src/worker/workflow/mod.rs +62 -58
- package/sdk-core/core/src/worker/workflow/run_cache.rs +5 -3
- package/sdk-core/core/src/worker/workflow/workflow_stream.rs +7 -5
- package/sdk-core/core-api/Cargo.toml +3 -3
- package/sdk-core/core-api/src/errors.rs +3 -11
- package/sdk-core/core-api/src/worker.rs +7 -0
- package/sdk-core/protos/api_upstream/.buildkite/Dockerfile +1 -1
- package/sdk-core/protos/api_upstream/.github/CODEOWNERS +1 -1
- package/sdk-core/protos/api_upstream/.github/PULL_REQUEST_TEMPLATE.md +2 -6
- package/sdk-core/protos/api_upstream/.github/workflows/trigger-api-go-update.yml +29 -0
- package/sdk-core/protos/api_upstream/Makefile +2 -2
- package/sdk-core/protos/api_upstream/buf.yaml +1 -0
- package/sdk-core/protos/api_upstream/temporal/api/batch/v1/message.proto +86 -0
- package/sdk-core/protos/api_upstream/temporal/api/command/v1/message.proto +26 -0
- package/sdk-core/protos/api_upstream/temporal/api/enums/v1/batch_operation.proto +46 -0
- package/sdk-core/protos/api_upstream/temporal/api/enums/v1/command_type.proto +7 -0
- package/sdk-core/protos/api_upstream/temporal/api/enums/v1/event_type.proto +14 -0
- package/sdk-core/protos/api_upstream/temporal/api/enums/v1/update.proto +51 -0
- package/sdk-core/protos/api_upstream/temporal/api/failure/v1/message.proto +18 -0
- package/sdk-core/protos/api_upstream/temporal/api/history/v1/message.proto +57 -1
- package/sdk-core/protos/api_upstream/temporal/api/operatorservice/v1/request_response.proto +1 -3
- package/sdk-core/protos/api_upstream/temporal/api/operatorservice/v1/service.proto +4 -2
- package/sdk-core/protos/api_upstream/temporal/api/replication/v1/message.proto +11 -0
- package/sdk-core/protos/api_upstream/temporal/api/taskqueue/v1/message.proto +23 -0
- package/sdk-core/protos/api_upstream/temporal/api/update/v1/message.proto +46 -0
- package/sdk-core/protos/api_upstream/temporal/api/workflow/v1/message.proto +1 -0
- package/sdk-core/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +172 -0
- package/sdk-core/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +30 -0
- package/sdk-core/protos/grpc/health/v1/health.proto +63 -0
- package/sdk-core/protos/local/temporal/sdk/core/workflow_commands/workflow_commands.proto +18 -15
- package/sdk-core/protos/testsrv_upstream/Makefile +80 -0
- package/sdk-core/protos/testsrv_upstream/api-linter.yaml +38 -0
- package/sdk-core/protos/testsrv_upstream/buf.yaml +13 -0
- package/sdk-core/protos/testsrv_upstream/dependencies/gogoproto/gogo.proto +141 -0
- package/sdk-core/protos/testsrv_upstream/temporal/api/testservice/v1/request_response.proto +63 -0
- package/sdk-core/protos/testsrv_upstream/temporal/api/testservice/v1/service.proto +90 -0
- package/sdk-core/sdk/Cargo.toml +2 -2
- package/sdk-core/sdk/src/lib.rs +2 -2
- package/sdk-core/sdk/src/workflow_context/options.rs +36 -8
- package/sdk-core/sdk/src/workflow_context.rs +30 -6
- package/sdk-core/sdk/src/workflow_future.rs +4 -4
- package/sdk-core/sdk-core-protos/Cargo.toml +5 -5
- package/sdk-core/sdk-core-protos/build.rs +9 -1
- package/sdk-core/sdk-core-protos/src/history_builder.rs +6 -1
- package/sdk-core/sdk-core-protos/src/lib.rs +93 -32
- package/sdk-core/test-utils/Cargo.toml +3 -3
- package/sdk-core/test-utils/src/canned_histories.rs +58 -0
- package/sdk-core/test-utils/src/lib.rs +35 -12
- package/sdk-core/tests/integ_tests/ephemeral_server_tests.rs +128 -0
- package/sdk-core/tests/integ_tests/heartbeat_tests.rs +55 -5
- package/sdk-core/tests/integ_tests/polling_tests.rs +2 -1
- package/sdk-core/tests/integ_tests/queries_tests.rs +5 -5
- package/sdk-core/tests/integ_tests/visibility_tests.rs +93 -0
- package/sdk-core/tests/integ_tests/workflow_tests/activities.rs +93 -10
- package/sdk-core/tests/integ_tests/workflow_tests/cancel_wf.rs +1 -1
- package/sdk-core/tests/integ_tests/workflow_tests/local_activities.rs +14 -14
- package/sdk-core/tests/integ_tests/workflow_tests/replay.rs +2 -6
- package/sdk-core/tests/integ_tests/workflow_tests/resets.rs +12 -12
- package/sdk-core/tests/integ_tests/workflow_tests/signals.rs +12 -1
- package/sdk-core/tests/integ_tests/workflow_tests/timers.rs +3 -3
- package/sdk-core/tests/integ_tests/workflow_tests/upsert_search_attrs.rs +8 -2
- package/sdk-core/tests/integ_tests/workflow_tests.rs +19 -4
- package/sdk-core/tests/load_tests.rs +2 -1
- package/sdk-core/tests/main.rs +17 -0
- package/sdk-core/tests/runner.rs +93 -0
- package/src/conversions.rs +157 -94
- package/src/helpers.rs +190 -0
- package/src/lib.rs +10 -912
- package/src/runtime.rs +436 -0
- package/src/testing.rs +67 -0
- package/src/worker.rs +465 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// Copyright 2015 The gRPC Authors
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
// The canonical version of this proto can be found at
|
|
16
|
+
// https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto
|
|
17
|
+
|
|
18
|
+
syntax = "proto3";
|
|
19
|
+
|
|
20
|
+
package grpc.health.v1;
|
|
21
|
+
|
|
22
|
+
option csharp_namespace = "Grpc.Health.V1";
|
|
23
|
+
option go_package = "google.golang.org/grpc/health/grpc_health_v1";
|
|
24
|
+
option java_multiple_files = true;
|
|
25
|
+
option java_outer_classname = "HealthProto";
|
|
26
|
+
option java_package = "io.grpc.health.v1";
|
|
27
|
+
|
|
28
|
+
message HealthCheckRequest {
|
|
29
|
+
string service = 1;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
message HealthCheckResponse {
|
|
33
|
+
enum ServingStatus {
|
|
34
|
+
UNKNOWN = 0;
|
|
35
|
+
SERVING = 1;
|
|
36
|
+
NOT_SERVING = 2;
|
|
37
|
+
SERVICE_UNKNOWN = 3; // Used only by the Watch method.
|
|
38
|
+
}
|
|
39
|
+
ServingStatus status = 1;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
service Health {
|
|
43
|
+
// If the requested service is unknown, the call will fail with status
|
|
44
|
+
// NOT_FOUND.
|
|
45
|
+
rpc Check(HealthCheckRequest) returns (HealthCheckResponse);
|
|
46
|
+
|
|
47
|
+
// Performs a watch for the serving status of the requested service.
|
|
48
|
+
// The server will immediately send back a message indicating the current
|
|
49
|
+
// serving status. It will then subsequently send a new message whenever
|
|
50
|
+
// the service's serving status changes.
|
|
51
|
+
//
|
|
52
|
+
// If the requested service is unknown when the call is received, the
|
|
53
|
+
// server will send a message setting the serving status to
|
|
54
|
+
// SERVICE_UNKNOWN but will *not* terminate the call. If at some
|
|
55
|
+
// future point, the serving status of the service becomes known, the
|
|
56
|
+
// server will send a new message with the service's serving status.
|
|
57
|
+
//
|
|
58
|
+
// If the call terminates with status UNIMPLEMENTED, then clients
|
|
59
|
+
// should assume this method is not supported and should not retry the
|
|
60
|
+
// call. If the call terminates with any other status (including OK),
|
|
61
|
+
// clients should retry the call with appropriate exponential backoff.
|
|
62
|
+
rpc Watch(HealthCheckRequest) returns (stream HealthCheckResponse);
|
|
63
|
+
}
|
|
@@ -28,7 +28,7 @@ message WorkflowCommand {
|
|
|
28
28
|
CancelWorkflowExecution cancel_workflow_execution = 9;
|
|
29
29
|
SetPatchMarker set_patch_marker = 10;
|
|
30
30
|
StartChildWorkflowExecution start_child_workflow_execution = 11;
|
|
31
|
-
|
|
31
|
+
CancelChildWorkflowExecution cancel_child_workflow_execution = 12;
|
|
32
32
|
RequestCancelExternalWorkflowExecution request_cancel_external_workflow_execution = 13;
|
|
33
33
|
SignalExternalWorkflowExecution signal_external_workflow_execution = 14;
|
|
34
34
|
CancelSignalWorkflow cancel_signal_workflow = 15;
|
|
@@ -173,27 +173,30 @@ message FailWorkflowExecution {
|
|
|
173
173
|
temporal.api.failure.v1.Failure failure = 1;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
//
|
|
177
|
-
/// Continue the workflow as a new execution. Unless noted otherwise, unset or default field values
|
|
178
|
-
/// will re-use the issuing workflow's values.
|
|
176
|
+
// Continue the workflow as a new execution
|
|
179
177
|
message ContinueAsNewWorkflowExecution {
|
|
180
|
-
|
|
178
|
+
// The identifier the lang-specific sdk uses to execute workflow code
|
|
181
179
|
string workflow_type = 1;
|
|
182
|
-
|
|
180
|
+
// Task queue for the new workflow execution
|
|
183
181
|
string task_queue = 2;
|
|
184
|
-
|
|
185
|
-
|
|
182
|
+
// Inputs to the workflow code. Should be specified. Will not re-use old arguments, as that
|
|
183
|
+
// typically wouldn't make any sense.
|
|
186
184
|
repeated temporal.api.common.v1.Payload arguments = 3;
|
|
187
|
-
|
|
185
|
+
// Timeout for a single run of the new workflow. Will not re-use current workflow's value.
|
|
188
186
|
google.protobuf.Duration workflow_run_timeout = 4;
|
|
189
|
-
|
|
187
|
+
// Timeout of a single workflow task. Will not re-use current workflow's value.
|
|
190
188
|
google.protobuf.Duration workflow_task_timeout = 5;
|
|
191
|
-
|
|
189
|
+
// If set, the new workflow will have this memo. If unset, re-uses the current workflow's memo
|
|
192
190
|
map<string, temporal.api.common.v1.Payload> memo = 6;
|
|
193
|
-
|
|
191
|
+
// If set, the new workflow will have these headers. Will *not* re-use current workflow's
|
|
192
|
+
// headers otherwise.
|
|
194
193
|
map<string, temporal.api.common.v1.Payload> headers = 7;
|
|
195
|
-
|
|
194
|
+
// If set, the new workflow will have these search attributes. If unset, re-uses the current
|
|
195
|
+
// workflow's search attributes.
|
|
196
196
|
map<string, temporal.api.common.v1.Payload> search_attributes = 8;
|
|
197
|
+
// If set, the new workflow will have this retry policy. If unset, re-uses the current
|
|
198
|
+
// workflow's retry policy.
|
|
199
|
+
temporal.api.common.v1.RetryPolicy retry_policy = 9;
|
|
197
200
|
}
|
|
198
201
|
|
|
199
202
|
/// Indicate a workflow has completed as cancelled. Generally sent as a response to an activation
|
|
@@ -243,8 +246,8 @@ message StartChildWorkflowExecution {
|
|
|
243
246
|
child_workflow.ChildWorkflowCancellationType cancellation_type = 18;
|
|
244
247
|
}
|
|
245
248
|
|
|
246
|
-
/// Cancel a
|
|
247
|
-
message
|
|
249
|
+
/// Cancel a child workflow
|
|
250
|
+
message CancelChildWorkflowExecution {
|
|
248
251
|
// Sequence number as given to the `StartChildWorkflowExecution` command
|
|
249
252
|
uint32 child_workflow_seq = 1;
|
|
250
253
|
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
$(VERBOSE).SILENT:
|
|
2
|
+
############################# Main targets #############################
|
|
3
|
+
ci-build: install proto
|
|
4
|
+
|
|
5
|
+
# Install dependencies.
|
|
6
|
+
install: grpc-install api-linter-install buf-install
|
|
7
|
+
|
|
8
|
+
# Run all linters and compile proto files.
|
|
9
|
+
proto: grpc
|
|
10
|
+
########################################################################
|
|
11
|
+
|
|
12
|
+
##### Variables ######
|
|
13
|
+
ifndef GOPATH
|
|
14
|
+
GOPATH := $(shell go env GOPATH)
|
|
15
|
+
endif
|
|
16
|
+
|
|
17
|
+
GOBIN := $(if $(shell go env GOBIN),$(shell go env GOBIN),$(GOPATH)/bin)
|
|
18
|
+
SHELL := PATH=$(GOBIN):$(PATH) /bin/sh
|
|
19
|
+
|
|
20
|
+
COLOR := "\e[1;36m%s\e[0m\n"
|
|
21
|
+
|
|
22
|
+
PROTO_ROOT := .
|
|
23
|
+
PROTO_FILES = $(shell find $(PROTO_ROOT) -name "*.proto")
|
|
24
|
+
PROTO_DIRS = $(sort $(dir $(PROTO_FILES)))
|
|
25
|
+
PROTO_OUT := .gen
|
|
26
|
+
PROTO_IMPORTS := -I=$(PROTO_ROOT) -I=$(GOPATH)/src/github.com/temporalio/gogo-protobuf/protobuf
|
|
27
|
+
|
|
28
|
+
$(PROTO_OUT):
|
|
29
|
+
mkdir $(PROTO_OUT)
|
|
30
|
+
|
|
31
|
+
##### Compile proto files for go #####
|
|
32
|
+
grpc: buf-lint api-linter buf-breaking gogo-grpc fix-path
|
|
33
|
+
|
|
34
|
+
go-grpc: clean $(PROTO_OUT)
|
|
35
|
+
printf $(COLOR) "Compile for go-gRPC..."
|
|
36
|
+
$(foreach PROTO_DIR,$(PROTO_DIRS),protoc $(PROTO_IMPORTS) --go_out=plugins=grpc,paths=source_relative:$(PROTO_OUT) $(PROTO_DIR)*.proto;)
|
|
37
|
+
|
|
38
|
+
gogo-grpc: clean $(PROTO_OUT)
|
|
39
|
+
printf $(COLOR) "Compile for gogo-gRPC..."
|
|
40
|
+
$(foreach PROTO_DIR,$(PROTO_DIRS),protoc $(PROTO_IMPORTS) --gogoslick_out=Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/descriptor.proto=github.com/golang/protobuf/protoc-gen-go/descriptor,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,plugins=grpc,paths=source_relative:$(PROTO_OUT) $(PROTO_DIR)*.proto;)
|
|
41
|
+
|
|
42
|
+
fix-path:
|
|
43
|
+
mv -f $(PROTO_OUT)/temporal/api/* $(PROTO_OUT) && rm -rf $(PROTO_OUT)/temporal
|
|
44
|
+
|
|
45
|
+
##### Plugins & tools #####
|
|
46
|
+
grpc-install: gogo-protobuf-install
|
|
47
|
+
printf $(COLOR) "Install/update gRPC plugins..."
|
|
48
|
+
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1.0
|
|
49
|
+
|
|
50
|
+
gogo-protobuf-install: go-protobuf-install
|
|
51
|
+
GO111MODULE=off go get github.com/temporalio/gogo-protobuf/protoc-gen-gogoslick
|
|
52
|
+
|
|
53
|
+
go-protobuf-install:
|
|
54
|
+
go install github.com/golang/protobuf/protoc-gen-go@v1.4.3
|
|
55
|
+
|
|
56
|
+
api-linter-install:
|
|
57
|
+
printf $(COLOR) "Install/update api-linter..."
|
|
58
|
+
go install github.com/googleapis/api-linter/cmd/api-linter@v1.22.0
|
|
59
|
+
|
|
60
|
+
buf-install:
|
|
61
|
+
printf $(COLOR) "Install/update buf..."
|
|
62
|
+
go install github.com/bufbuild/buf/cmd/buf@v0.43.2
|
|
63
|
+
|
|
64
|
+
##### Linters #####
|
|
65
|
+
api-linter:
|
|
66
|
+
printf $(COLOR) "Run api-linter..."
|
|
67
|
+
api-linter --set-exit-status $(PROTO_IMPORTS) --config $(PROTO_ROOT)/api-linter.yaml $(PROTO_FILES)
|
|
68
|
+
|
|
69
|
+
buf-lint:
|
|
70
|
+
printf $(COLOR) "Run buf linter..."
|
|
71
|
+
(cd $(PROTO_ROOT) && buf lint)
|
|
72
|
+
|
|
73
|
+
buf-breaking:
|
|
74
|
+
# @printf $(COLOR) "Run buf breaking changes check against master branch..."
|
|
75
|
+
# @(cd $(PROTO_ROOT) && buf breaking --against '../../../../.git#branch=master')
|
|
76
|
+
|
|
77
|
+
##### Clean #####
|
|
78
|
+
clean:
|
|
79
|
+
printf $(COLOR) "Delete generated go files..."
|
|
80
|
+
rm -rf $(PROTO_OUT)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
- included_paths:
|
|
2
|
+
- '**/*.proto'
|
|
3
|
+
disabled_rules:
|
|
4
|
+
- 'core::0192::has-comments'
|
|
5
|
+
|
|
6
|
+
- included_paths:
|
|
7
|
+
- '**/message.proto'
|
|
8
|
+
disabled_rules:
|
|
9
|
+
- 'core::0122::name-suffix'
|
|
10
|
+
- 'core::0123::resource-annotation'
|
|
11
|
+
|
|
12
|
+
- included_paths:
|
|
13
|
+
- '**/testservice/v1/request_response.proto'
|
|
14
|
+
disabled_rules:
|
|
15
|
+
- 'core::0122::name-suffix'
|
|
16
|
+
- 'core::0131::request-name-required'
|
|
17
|
+
- 'core::0131::request-unknown-fields'
|
|
18
|
+
- 'core::0132::request-parent-required'
|
|
19
|
+
- 'core::0132::request-unknown-fields'
|
|
20
|
+
- 'core::0132::response-unknown-fields'
|
|
21
|
+
- 'core::0134::request-unknown-fields'
|
|
22
|
+
- 'core::0158::request-page-size-field'
|
|
23
|
+
- 'core::0158::request-page-token-field'
|
|
24
|
+
- 'core::0158::response-next-page-token-field'
|
|
25
|
+
- 'core::0158::response-plural-first-field'
|
|
26
|
+
- 'core::0158::response-repeated-first-field'
|
|
27
|
+
|
|
28
|
+
- included_paths:
|
|
29
|
+
- '**/testservice/v1/service.proto'
|
|
30
|
+
disabled_rules:
|
|
31
|
+
- 'core::0127::http-annotation'
|
|
32
|
+
- 'core::0131::method-signature'
|
|
33
|
+
- 'core::0131::response-message-name'
|
|
34
|
+
|
|
35
|
+
- included_paths:
|
|
36
|
+
- 'dependencies/gogoproto/gogo.proto'
|
|
37
|
+
disabled_rules:
|
|
38
|
+
- 'all'
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
// Protocol Buffers for Go with Gadgets
|
|
2
|
+
//
|
|
3
|
+
// Copyright (c) 2013, The GoGo Authors. All rights reserved.
|
|
4
|
+
// http://github.com/temporalio/gogo-protobuf
|
|
5
|
+
//
|
|
6
|
+
// Redistribution and use in source and binary forms, with or without
|
|
7
|
+
// modification, are permitted provided that the following conditions are
|
|
8
|
+
// met:
|
|
9
|
+
//
|
|
10
|
+
// * Redistributions of source code must retain the above copyright
|
|
11
|
+
// notice, this list of conditions and the following disclaimer.
|
|
12
|
+
// * Redistributions in binary form must reproduce the above
|
|
13
|
+
// copyright notice, this list of conditions and the following disclaimer
|
|
14
|
+
// in the documentation and/or other materials provided with the
|
|
15
|
+
// distribution.
|
|
16
|
+
//
|
|
17
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
18
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
19
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
20
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
21
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
22
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
23
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
24
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
25
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
27
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
+
|
|
29
|
+
syntax = "proto2";
|
|
30
|
+
package gogoproto;
|
|
31
|
+
|
|
32
|
+
import "google/protobuf/descriptor.proto";
|
|
33
|
+
|
|
34
|
+
option go_package = "github.com/gogo/protobuf/gogoproto";
|
|
35
|
+
|
|
36
|
+
extend google.protobuf.EnumOptions {
|
|
37
|
+
optional bool goproto_enum_prefix = 62001;
|
|
38
|
+
optional bool goproto_enum_stringer = 62021;
|
|
39
|
+
optional bool enum_stringer = 62022;
|
|
40
|
+
optional string enum_customname = 62023;
|
|
41
|
+
optional bool enumdecl = 62024;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
extend google.protobuf.EnumValueOptions {
|
|
45
|
+
optional string enumvalue_customname = 66001;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
extend google.protobuf.FileOptions {
|
|
49
|
+
optional bool goproto_getters_all = 63001;
|
|
50
|
+
optional bool goproto_enum_prefix_all = 63002;
|
|
51
|
+
optional bool goproto_stringer_all = 63003;
|
|
52
|
+
optional bool verbose_equal_all = 63004;
|
|
53
|
+
optional bool face_all = 63005;
|
|
54
|
+
optional bool gostring_all = 63006;
|
|
55
|
+
optional bool populate_all = 63007;
|
|
56
|
+
optional bool stringer_all = 63008;
|
|
57
|
+
optional bool onlyone_all = 63009;
|
|
58
|
+
|
|
59
|
+
optional bool equal_all = 63013;
|
|
60
|
+
optional bool description_all = 63014;
|
|
61
|
+
optional bool testgen_all = 63015;
|
|
62
|
+
optional bool benchgen_all = 63016;
|
|
63
|
+
optional bool marshaler_all = 63017;
|
|
64
|
+
optional bool unmarshaler_all = 63018;
|
|
65
|
+
optional bool stable_marshaler_all = 63019;
|
|
66
|
+
|
|
67
|
+
optional bool sizer_all = 63020;
|
|
68
|
+
|
|
69
|
+
optional bool goproto_enum_stringer_all = 63021;
|
|
70
|
+
optional bool enum_stringer_all = 63022;
|
|
71
|
+
|
|
72
|
+
optional bool unsafe_marshaler_all = 63023;
|
|
73
|
+
optional bool unsafe_unmarshaler_all = 63024;
|
|
74
|
+
|
|
75
|
+
optional bool goproto_extensions_map_all = 63025;
|
|
76
|
+
optional bool goproto_unrecognized_all = 63026;
|
|
77
|
+
optional bool gogoproto_import = 63027;
|
|
78
|
+
optional bool protosizer_all = 63028;
|
|
79
|
+
optional bool compare_all = 63029;
|
|
80
|
+
optional bool typedecl_all = 63030;
|
|
81
|
+
optional bool enumdecl_all = 63031;
|
|
82
|
+
|
|
83
|
+
optional bool goproto_registration = 63032;
|
|
84
|
+
optional bool messagename_all = 63033;
|
|
85
|
+
|
|
86
|
+
optional bool goproto_sizecache_all = 63034;
|
|
87
|
+
optional bool goproto_unkeyed_all = 63035;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
extend google.protobuf.MessageOptions {
|
|
91
|
+
optional bool goproto_getters = 64001;
|
|
92
|
+
optional bool goproto_stringer = 64003;
|
|
93
|
+
optional bool verbose_equal = 64004;
|
|
94
|
+
optional bool face = 64005;
|
|
95
|
+
optional bool gostring = 64006;
|
|
96
|
+
optional bool populate = 64007;
|
|
97
|
+
optional bool stringer = 67008;
|
|
98
|
+
optional bool onlyone = 64009;
|
|
99
|
+
|
|
100
|
+
optional bool equal = 64013;
|
|
101
|
+
optional bool description = 64014;
|
|
102
|
+
optional bool testgen = 64015;
|
|
103
|
+
optional bool benchgen = 64016;
|
|
104
|
+
optional bool marshaler = 64017;
|
|
105
|
+
optional bool unmarshaler = 64018;
|
|
106
|
+
optional bool stable_marshaler = 64019;
|
|
107
|
+
|
|
108
|
+
optional bool sizer = 64020;
|
|
109
|
+
|
|
110
|
+
optional bool unsafe_marshaler = 64023;
|
|
111
|
+
optional bool unsafe_unmarshaler = 64024;
|
|
112
|
+
|
|
113
|
+
optional bool goproto_extensions_map = 64025;
|
|
114
|
+
optional bool goproto_unrecognized = 64026;
|
|
115
|
+
|
|
116
|
+
optional bool protosizer = 64028;
|
|
117
|
+
optional bool compare = 64029;
|
|
118
|
+
|
|
119
|
+
optional bool typedecl = 64030;
|
|
120
|
+
|
|
121
|
+
optional bool messagename = 64033;
|
|
122
|
+
|
|
123
|
+
optional bool goproto_sizecache = 64034;
|
|
124
|
+
optional bool goproto_unkeyed = 64035;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
extend google.protobuf.FieldOptions {
|
|
128
|
+
optional bool nullable = 65001;
|
|
129
|
+
optional bool embed = 65002;
|
|
130
|
+
optional string customtype = 65003;
|
|
131
|
+
optional string customname = 65004;
|
|
132
|
+
optional string jsontag = 65005;
|
|
133
|
+
optional string moretags = 65006;
|
|
134
|
+
optional string casttype = 65007;
|
|
135
|
+
optional string castkey = 65008;
|
|
136
|
+
optional string castvalue = 65009;
|
|
137
|
+
|
|
138
|
+
optional bool stdtime = 65010;
|
|
139
|
+
optional bool stdduration = 65011;
|
|
140
|
+
optional bool wktpointer = 65012;
|
|
141
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// The MIT License
|
|
2
|
+
//
|
|
3
|
+
// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
// in the Software without restriction, including without limitation the rights
|
|
8
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
// furnished to do so, subject to the following conditions:
|
|
11
|
+
//
|
|
12
|
+
// The above copyright notice and this permission notice shall be included in
|
|
13
|
+
// all copies or substantial portions of the Software.
|
|
14
|
+
//
|
|
15
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
// THE SOFTWARE.
|
|
22
|
+
|
|
23
|
+
syntax = "proto3";
|
|
24
|
+
|
|
25
|
+
package temporal.api.testservice.v1;
|
|
26
|
+
|
|
27
|
+
option go_package = "go.temporal.io/api/testservice/v1;testservice";
|
|
28
|
+
option java_package = "io.temporal.api.testservice.v1";
|
|
29
|
+
option java_multiple_files = true;
|
|
30
|
+
option java_outer_classname = "RequestResponseProto";
|
|
31
|
+
option ruby_package = "Temporal::Api::TestService::V1";
|
|
32
|
+
option csharp_namespace = "Temporal.Api.TestService.V1";
|
|
33
|
+
|
|
34
|
+
import "google/protobuf/duration.proto";
|
|
35
|
+
import "google/protobuf/timestamp.proto";
|
|
36
|
+
import "dependencies/gogoproto/gogo.proto";
|
|
37
|
+
|
|
38
|
+
message LockTimeSkippingRequest {
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
message LockTimeSkippingResponse {
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
message UnlockTimeSkippingRequest {
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
message UnlockTimeSkippingResponse {
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
message SleepUntilRequest {
|
|
51
|
+
google.protobuf.Timestamp timestamp = 1 [(gogoproto.stdtime) = true];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
message SleepRequest {
|
|
55
|
+
google.protobuf.Duration duration = 1 [(gogoproto.stdduration) = true];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
message SleepResponse {
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
message GetCurrentTimeResponse {
|
|
62
|
+
google.protobuf.Timestamp time = 1 [(gogoproto.stdtime) = true];
|
|
63
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// The MIT License
|
|
2
|
+
//
|
|
3
|
+
// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
// in the Software without restriction, including without limitation the rights
|
|
8
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
// furnished to do so, subject to the following conditions:
|
|
11
|
+
//
|
|
12
|
+
// The above copyright notice and this permission notice shall be included in
|
|
13
|
+
// all copies or substantial portions of the Software.
|
|
14
|
+
//
|
|
15
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
// THE SOFTWARE.
|
|
22
|
+
|
|
23
|
+
syntax = "proto3";
|
|
24
|
+
|
|
25
|
+
package temporal.api.testservice.v1;
|
|
26
|
+
|
|
27
|
+
option go_package = "go.temporal.io/api/testservice/v1;testservice";
|
|
28
|
+
option java_package = "io.temporal.api.testservice.v1";
|
|
29
|
+
option java_multiple_files = true;
|
|
30
|
+
option java_outer_classname = "ServiceProto";
|
|
31
|
+
option ruby_package = "Temporal::Api::TestService::V1";
|
|
32
|
+
option csharp_namespace = "Temporal.Api.TestService.V1";
|
|
33
|
+
|
|
34
|
+
import "temporal/api/testservice/v1/request_response.proto";
|
|
35
|
+
import "google/protobuf/empty.proto";
|
|
36
|
+
|
|
37
|
+
// TestService API defines an interface supported only by the Temporal Test Server.
|
|
38
|
+
// It provides functionality needed or supported for testing purposes only.
|
|
39
|
+
//
|
|
40
|
+
// This is an EXPERIMENTAL API.
|
|
41
|
+
service TestService {
|
|
42
|
+
// LockTimeSkipping increments Time Locking Counter by one.
|
|
43
|
+
//
|
|
44
|
+
// If Time Locking Counter is positive, time skipping is locked (disabled).
|
|
45
|
+
// When time skipping is disabled, the time in test server is moving normally, with a real time pace.
|
|
46
|
+
// Test Server is typically started with locked time skipping and Time Locking Counter = 1.
|
|
47
|
+
//
|
|
48
|
+
// LockTimeSkipping and UnlockTimeSkipping calls are counted.
|
|
49
|
+
rpc LockTimeSkipping (LockTimeSkippingRequest) returns (LockTimeSkippingResponse) {
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// UnlockTimeSkipping decrements Time Locking Counter by one.
|
|
53
|
+
//
|
|
54
|
+
// If the counter reaches 0, it unlocks time skipping and fast forwards time.
|
|
55
|
+
// LockTimeSkipping and UnlockTimeSkipping calls are counted. Calling UnlockTimeSkipping does not
|
|
56
|
+
// guarantee that time is going to be fast forwarded as another lock can be holding it.
|
|
57
|
+
//
|
|
58
|
+
// Time Locking Counter can't be negative, unbalanced calls to UnlockTimeSkipping will lead to rpc call failure
|
|
59
|
+
rpc UnlockTimeSkipping (UnlockTimeSkippingRequest) returns (UnlockTimeSkippingResponse) {
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// This call returns only when the Test Server Time advances by the specified duration.
|
|
63
|
+
// This is an EXPERIMENTAL API.
|
|
64
|
+
rpc Sleep (SleepRequest) returns (SleepResponse) {
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// This call returns only when the Test Server Time advances to the specified timestamp.
|
|
68
|
+
// If the current Test Server Time is beyond the specified timestamp, returns immediately.
|
|
69
|
+
// This is an EXPERIMENTAL API.
|
|
70
|
+
rpc SleepUntil (SleepUntilRequest) returns (SleepResponse) {
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// UnlockTimeSkippingWhileSleep decreases time locking counter by one and increases it back
|
|
74
|
+
// once the Test Server Time advances by the duration specified in the request.
|
|
75
|
+
//
|
|
76
|
+
// This call returns only when the Test Server Time advances by the specified duration.
|
|
77
|
+
//
|
|
78
|
+
// If it is called when Time Locking Counter is
|
|
79
|
+
// - more than 1 and no other unlocks are coming in, rpc call will block for the specified duration, time will not be fast forwarded.
|
|
80
|
+
// - 1, it will lead to fast forwarding of the time by the duration specified in the request and quick return of this rpc call.
|
|
81
|
+
// - 0 will lead to rpc call failure same way as an unbalanced UnlockTimeSkipping.
|
|
82
|
+
rpc UnlockTimeSkippingWithSleep (SleepRequest) returns (SleepResponse) {
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// GetCurrentTime returns the current Temporal Test Server time
|
|
86
|
+
//
|
|
87
|
+
// This time might not be equal to {@link System#currentTimeMillis()} due to time skipping.
|
|
88
|
+
rpc GetCurrentTime (google.protobuf.Empty) returns (GetCurrentTimeResponse) {
|
|
89
|
+
}
|
|
90
|
+
}
|
package/sdk-core/sdk/Cargo.toml
CHANGED
|
@@ -21,13 +21,13 @@ derive_more = "0.99"
|
|
|
21
21
|
futures = "0.3"
|
|
22
22
|
once_cell = "1.10"
|
|
23
23
|
parking_lot = { version = "0.12", features = ["send_guard"] }
|
|
24
|
-
prost-types = "0.
|
|
24
|
+
prost-types = "0.11"
|
|
25
25
|
sha2 = "0.10"
|
|
26
26
|
serde = "1.0"
|
|
27
27
|
tokio = { version = "1.1", features = ["rt", "rt-multi-thread", "parking_lot", "time", "fs"] }
|
|
28
28
|
tokio-util = { version = "0.7" }
|
|
29
29
|
tokio-stream = "0.1"
|
|
30
|
-
tonic = "0.
|
|
30
|
+
tonic = "0.8"
|
|
31
31
|
tracing = { version = "0.1", features = ["log-always"] }
|
|
32
32
|
|
|
33
33
|
[dependencies.temporal-sdk-core]
|
package/sdk-core/sdk/src/lib.rs
CHANGED
|
@@ -53,7 +53,7 @@ mod workflow_context;
|
|
|
53
53
|
mod workflow_future;
|
|
54
54
|
|
|
55
55
|
pub use activity_context::ActContext;
|
|
56
|
-
|
|
56
|
+
pub use temporal_client::Namespace;
|
|
57
57
|
pub use workflow_context::{
|
|
58
58
|
ActivityOptions, CancellableFuture, ChildWorkflow, ChildWorkflowOptions, LocalActivityOptions,
|
|
59
59
|
Signal, SignalData, SignalWorkflowOptions, WfContext,
|
|
@@ -720,7 +720,7 @@ impl<T: Debug> WfExitValue<T> {
|
|
|
720
720
|
}
|
|
721
721
|
|
|
722
722
|
/// Activity functions may return these values when exiting
|
|
723
|
-
#[derive(
|
|
723
|
+
#[derive(derive_more::From)]
|
|
724
724
|
pub enum ActExitValue<T: Debug> {
|
|
725
725
|
/// Completion requires an asynchronous callback
|
|
726
726
|
#[from(ignore)]
|