temporalio 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +130 -0
- data/bridge/Cargo.lock +2865 -0
- data/bridge/Cargo.toml +26 -0
- data/bridge/sdk-core/ARCHITECTURE.md +76 -0
- data/bridge/sdk-core/Cargo.lock +2606 -0
- data/bridge/sdk-core/Cargo.toml +2 -0
- data/bridge/sdk-core/LICENSE.txt +23 -0
- data/bridge/sdk-core/README.md +107 -0
- data/bridge/sdk-core/arch_docs/diagrams/README.md +10 -0
- data/bridge/sdk-core/arch_docs/diagrams/sticky_queues.puml +40 -0
- data/bridge/sdk-core/arch_docs/diagrams/workflow_internals.svg +1 -0
- data/bridge/sdk-core/arch_docs/sticky_queues.md +51 -0
- data/bridge/sdk-core/bridge-ffi/Cargo.toml +24 -0
- data/bridge/sdk-core/bridge-ffi/LICENSE.txt +23 -0
- data/bridge/sdk-core/bridge-ffi/build.rs +25 -0
- data/bridge/sdk-core/bridge-ffi/include/sdk-core-bridge.h +249 -0
- data/bridge/sdk-core/bridge-ffi/src/lib.rs +825 -0
- data/bridge/sdk-core/bridge-ffi/src/wrappers.rs +211 -0
- data/bridge/sdk-core/client/Cargo.toml +40 -0
- data/bridge/sdk-core/client/LICENSE.txt +23 -0
- data/bridge/sdk-core/client/src/lib.rs +1294 -0
- data/bridge/sdk-core/client/src/metrics.rs +165 -0
- data/bridge/sdk-core/client/src/raw.rs +931 -0
- data/bridge/sdk-core/client/src/retry.rs +674 -0
- data/bridge/sdk-core/client/src/workflow_handle/mod.rs +185 -0
- data/bridge/sdk-core/core/Cargo.toml +116 -0
- data/bridge/sdk-core/core/LICENSE.txt +23 -0
- data/bridge/sdk-core/core/benches/workflow_replay.rs +73 -0
- data/bridge/sdk-core/core/src/abstractions.rs +166 -0
- data/bridge/sdk-core/core/src/core_tests/activity_tasks.rs +911 -0
- data/bridge/sdk-core/core/src/core_tests/child_workflows.rs +221 -0
- data/bridge/sdk-core/core/src/core_tests/determinism.rs +107 -0
- data/bridge/sdk-core/core/src/core_tests/local_activities.rs +515 -0
- data/bridge/sdk-core/core/src/core_tests/mod.rs +100 -0
- data/bridge/sdk-core/core/src/core_tests/queries.rs +736 -0
- data/bridge/sdk-core/core/src/core_tests/replay_flag.rs +65 -0
- data/bridge/sdk-core/core/src/core_tests/workers.rs +259 -0
- data/bridge/sdk-core/core/src/core_tests/workflow_cancels.rs +124 -0
- data/bridge/sdk-core/core/src/core_tests/workflow_tasks.rs +2070 -0
- data/bridge/sdk-core/core/src/ephemeral_server/mod.rs +515 -0
- data/bridge/sdk-core/core/src/lib.rs +175 -0
- data/bridge/sdk-core/core/src/log_export.rs +62 -0
- data/bridge/sdk-core/core/src/pollers/mod.rs +54 -0
- data/bridge/sdk-core/core/src/pollers/poll_buffer.rs +297 -0
- data/bridge/sdk-core/core/src/protosext/mod.rs +428 -0
- data/bridge/sdk-core/core/src/replay/mod.rs +71 -0
- data/bridge/sdk-core/core/src/retry_logic.rs +202 -0
- data/bridge/sdk-core/core/src/telemetry/metrics.rs +383 -0
- data/bridge/sdk-core/core/src/telemetry/mod.rs +412 -0
- data/bridge/sdk-core/core/src/telemetry/prometheus_server.rs +77 -0
- data/bridge/sdk-core/core/src/test_help/mod.rs +875 -0
- data/bridge/sdk-core/core/src/worker/activities/activity_heartbeat_manager.rs +580 -0
- data/bridge/sdk-core/core/src/worker/activities/local_activities.rs +1042 -0
- data/bridge/sdk-core/core/src/worker/activities.rs +464 -0
- data/bridge/sdk-core/core/src/worker/client/mocks.rs +87 -0
- data/bridge/sdk-core/core/src/worker/client.rs +347 -0
- data/bridge/sdk-core/core/src/worker/mod.rs +566 -0
- data/bridge/sdk-core/core/src/worker/workflow/bridge.rs +37 -0
- data/bridge/sdk-core/core/src/worker/workflow/driven_workflow.rs +110 -0
- data/bridge/sdk-core/core/src/worker/workflow/history_update.rs +458 -0
- data/bridge/sdk-core/core/src/worker/workflow/machines/activity_state_machine.rs +911 -0
- data/bridge/sdk-core/core/src/worker/workflow/machines/cancel_external_state_machine.rs +298 -0
- data/bridge/sdk-core/core/src/worker/workflow/machines/cancel_workflow_state_machine.rs +171 -0
- data/bridge/sdk-core/core/src/worker/workflow/machines/child_workflow_state_machine.rs +860 -0
- data/bridge/sdk-core/core/src/worker/workflow/machines/complete_workflow_state_machine.rs +140 -0
- data/bridge/sdk-core/core/src/worker/workflow/machines/continue_as_new_workflow_state_machine.rs +161 -0
- data/bridge/sdk-core/core/src/worker/workflow/machines/fail_workflow_state_machine.rs +133 -0
- data/bridge/sdk-core/core/src/worker/workflow/machines/local_activity_state_machine.rs +1448 -0
- data/bridge/sdk-core/core/src/worker/workflow/machines/mod.rs +342 -0
- data/bridge/sdk-core/core/src/worker/workflow/machines/mutable_side_effect_state_machine.rs +127 -0
- data/bridge/sdk-core/core/src/worker/workflow/machines/patch_state_machine.rs +712 -0
- data/bridge/sdk-core/core/src/worker/workflow/machines/side_effect_state_machine.rs +71 -0
- data/bridge/sdk-core/core/src/worker/workflow/machines/signal_external_state_machine.rs +443 -0
- data/bridge/sdk-core/core/src/worker/workflow/machines/timer_state_machine.rs +439 -0
- data/bridge/sdk-core/core/src/worker/workflow/machines/transition_coverage.rs +169 -0
- data/bridge/sdk-core/core/src/worker/workflow/machines/upsert_search_attributes_state_machine.rs +246 -0
- data/bridge/sdk-core/core/src/worker/workflow/machines/workflow_machines/local_acts.rs +96 -0
- data/bridge/sdk-core/core/src/worker/workflow/machines/workflow_machines.rs +1184 -0
- data/bridge/sdk-core/core/src/worker/workflow/machines/workflow_task_state_machine.rs +277 -0
- data/bridge/sdk-core/core/src/worker/workflow/managed_run/managed_wf_test.rs +198 -0
- data/bridge/sdk-core/core/src/worker/workflow/managed_run.rs +647 -0
- data/bridge/sdk-core/core/src/worker/workflow/mod.rs +1143 -0
- data/bridge/sdk-core/core/src/worker/workflow/run_cache.rs +145 -0
- data/bridge/sdk-core/core/src/worker/workflow/wft_poller.rs +88 -0
- data/bridge/sdk-core/core/src/worker/workflow/workflow_stream.rs +940 -0
- data/bridge/sdk-core/core-api/Cargo.toml +31 -0
- data/bridge/sdk-core/core-api/LICENSE.txt +23 -0
- data/bridge/sdk-core/core-api/src/errors.rs +95 -0
- data/bridge/sdk-core/core-api/src/lib.rs +151 -0
- data/bridge/sdk-core/core-api/src/worker.rs +135 -0
- data/bridge/sdk-core/etc/deps.svg +187 -0
- data/bridge/sdk-core/etc/dynamic-config.yaml +2 -0
- data/bridge/sdk-core/etc/otel-collector-config.yaml +36 -0
- data/bridge/sdk-core/etc/prometheus.yaml +6 -0
- data/bridge/sdk-core/fsm/Cargo.toml +18 -0
- data/bridge/sdk-core/fsm/LICENSE.txt +23 -0
- data/bridge/sdk-core/fsm/README.md +3 -0
- data/bridge/sdk-core/fsm/rustfsm_procmacro/Cargo.toml +27 -0
- data/bridge/sdk-core/fsm/rustfsm_procmacro/LICENSE.txt +23 -0
- data/bridge/sdk-core/fsm/rustfsm_procmacro/src/lib.rs +647 -0
- data/bridge/sdk-core/fsm/rustfsm_procmacro/tests/progress.rs +8 -0
- data/bridge/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/dupe_transitions_fail.rs +18 -0
- data/bridge/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/dupe_transitions_fail.stderr +12 -0
- data/bridge/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/dynamic_dest_pass.rs +41 -0
- data/bridge/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/forgot_name_fail.rs +14 -0
- data/bridge/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/forgot_name_fail.stderr +11 -0
- data/bridge/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/handler_arg_pass.rs +32 -0
- data/bridge/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/handler_pass.rs +31 -0
- data/bridge/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/medium_complex_pass.rs +46 -0
- data/bridge/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/no_handle_conversions_require_into_fail.rs +29 -0
- data/bridge/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/no_handle_conversions_require_into_fail.stderr +12 -0
- data/bridge/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/simple_pass.rs +32 -0
- data/bridge/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/struct_event_variant_fail.rs +18 -0
- data/bridge/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/struct_event_variant_fail.stderr +5 -0
- data/bridge/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/tuple_more_item_event_variant_fail.rs +11 -0
- data/bridge/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/tuple_more_item_event_variant_fail.stderr +5 -0
- data/bridge/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/tuple_zero_item_event_variant_fail.rs +11 -0
- data/bridge/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/tuple_zero_item_event_variant_fail.stderr +5 -0
- data/bridge/sdk-core/fsm/rustfsm_trait/Cargo.toml +14 -0
- data/bridge/sdk-core/fsm/rustfsm_trait/LICENSE.txt +23 -0
- data/bridge/sdk-core/fsm/rustfsm_trait/src/lib.rs +249 -0
- data/bridge/sdk-core/fsm/src/lib.rs +2 -0
- data/bridge/sdk-core/histories/fail_wf_task.bin +0 -0
- data/bridge/sdk-core/histories/timer_workflow_history.bin +0 -0
- data/bridge/sdk-core/integ-with-otel.sh +7 -0
- data/bridge/sdk-core/protos/api_upstream/README.md +9 -0
- data/bridge/sdk-core/protos/api_upstream/api-linter.yaml +40 -0
- data/bridge/sdk-core/protos/api_upstream/buf.yaml +12 -0
- data/bridge/sdk-core/protos/api_upstream/dependencies/gogoproto/gogo.proto +141 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/batch/v1/message.proto +86 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/cluster/v1/message.proto +83 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/command/v1/message.proto +259 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/common/v1/message.proto +112 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/enums/v1/batch_operation.proto +46 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/enums/v1/cluster.proto +40 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/enums/v1/command_type.proto +57 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/enums/v1/common.proto +55 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/enums/v1/event_type.proto +168 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/enums/v1/failed_cause.proto +97 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/enums/v1/namespace.proto +51 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/enums/v1/query.proto +50 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/enums/v1/reset.proto +41 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/enums/v1/schedule.proto +60 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/enums/v1/task_queue.proto +59 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/enums/v1/update.proto +51 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/enums/v1/workflow.proto +122 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/errordetails/v1/message.proto +108 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/failure/v1/message.proto +114 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/filter/v1/message.proto +56 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/history/v1/message.proto +751 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/namespace/v1/message.proto +97 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/operatorservice/v1/request_response.proto +161 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/operatorservice/v1/service.proto +99 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/query/v1/message.proto +61 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/replication/v1/message.proto +55 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/schedule/v1/message.proto +300 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/taskqueue/v1/message.proto +108 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/update/v1/message.proto +46 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/version/v1/message.proto +59 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/workflow/v1/message.proto +145 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +1124 -0
- data/bridge/sdk-core/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +401 -0
- data/bridge/sdk-core/protos/grpc/health/v1/health.proto +63 -0
- data/bridge/sdk-core/protos/local/temporal/sdk/core/activity_result/activity_result.proto +78 -0
- data/bridge/sdk-core/protos/local/temporal/sdk/core/activity_task/activity_task.proto +79 -0
- data/bridge/sdk-core/protos/local/temporal/sdk/core/bridge/bridge.proto +210 -0
- data/bridge/sdk-core/protos/local/temporal/sdk/core/child_workflow/child_workflow.proto +77 -0
- data/bridge/sdk-core/protos/local/temporal/sdk/core/common/common.proto +15 -0
- data/bridge/sdk-core/protos/local/temporal/sdk/core/core_interface.proto +30 -0
- data/bridge/sdk-core/protos/local/temporal/sdk/core/external_data/external_data.proto +30 -0
- data/bridge/sdk-core/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +261 -0
- data/bridge/sdk-core/protos/local/temporal/sdk/core/workflow_commands/workflow_commands.proto +297 -0
- data/bridge/sdk-core/protos/local/temporal/sdk/core/workflow_completion/workflow_completion.proto +29 -0
- data/bridge/sdk-core/protos/testsrv_upstream/api-linter.yaml +38 -0
- data/bridge/sdk-core/protos/testsrv_upstream/buf.yaml +13 -0
- data/bridge/sdk-core/protos/testsrv_upstream/dependencies/gogoproto/gogo.proto +141 -0
- data/bridge/sdk-core/protos/testsrv_upstream/temporal/api/testservice/v1/request_response.proto +63 -0
- data/bridge/sdk-core/protos/testsrv_upstream/temporal/api/testservice/v1/service.proto +90 -0
- data/bridge/sdk-core/rustfmt.toml +1 -0
- data/bridge/sdk-core/sdk/Cargo.toml +47 -0
- data/bridge/sdk-core/sdk/LICENSE.txt +23 -0
- data/bridge/sdk-core/sdk/src/activity_context.rs +230 -0
- data/bridge/sdk-core/sdk/src/app_data.rs +37 -0
- data/bridge/sdk-core/sdk/src/conversions.rs +8 -0
- data/bridge/sdk-core/sdk/src/interceptors.rs +17 -0
- data/bridge/sdk-core/sdk/src/lib.rs +792 -0
- data/bridge/sdk-core/sdk/src/payload_converter.rs +11 -0
- data/bridge/sdk-core/sdk/src/workflow_context/options.rs +295 -0
- data/bridge/sdk-core/sdk/src/workflow_context.rs +683 -0
- data/bridge/sdk-core/sdk/src/workflow_future.rs +503 -0
- data/bridge/sdk-core/sdk-core-protos/Cargo.toml +30 -0
- data/bridge/sdk-core/sdk-core-protos/LICENSE.txt +23 -0
- data/bridge/sdk-core/sdk-core-protos/build.rs +108 -0
- data/bridge/sdk-core/sdk-core-protos/src/constants.rs +7 -0
- data/bridge/sdk-core/sdk-core-protos/src/history_builder.rs +497 -0
- data/bridge/sdk-core/sdk-core-protos/src/history_info.rs +230 -0
- data/bridge/sdk-core/sdk-core-protos/src/lib.rs +1910 -0
- data/bridge/sdk-core/sdk-core-protos/src/task_token.rs +38 -0
- data/bridge/sdk-core/sdk-core-protos/src/utilities.rs +14 -0
- data/bridge/sdk-core/test-utils/Cargo.toml +35 -0
- data/bridge/sdk-core/test-utils/src/canned_histories.rs +1579 -0
- data/bridge/sdk-core/test-utils/src/histfetch.rs +28 -0
- data/bridge/sdk-core/test-utils/src/lib.rs +598 -0
- data/bridge/sdk-core/tests/integ_tests/client_tests.rs +36 -0
- data/bridge/sdk-core/tests/integ_tests/ephemeral_server_tests.rs +128 -0
- data/bridge/sdk-core/tests/integ_tests/heartbeat_tests.rs +218 -0
- data/bridge/sdk-core/tests/integ_tests/polling_tests.rs +146 -0
- data/bridge/sdk-core/tests/integ_tests/queries_tests.rs +437 -0
- data/bridge/sdk-core/tests/integ_tests/visibility_tests.rs +93 -0
- data/bridge/sdk-core/tests/integ_tests/workflow_tests/activities.rs +878 -0
- data/bridge/sdk-core/tests/integ_tests/workflow_tests/appdata_propagation.rs +61 -0
- data/bridge/sdk-core/tests/integ_tests/workflow_tests/cancel_external.rs +59 -0
- data/bridge/sdk-core/tests/integ_tests/workflow_tests/cancel_wf.rs +58 -0
- data/bridge/sdk-core/tests/integ_tests/workflow_tests/child_workflows.rs +50 -0
- data/bridge/sdk-core/tests/integ_tests/workflow_tests/continue_as_new.rs +60 -0
- data/bridge/sdk-core/tests/integ_tests/workflow_tests/determinism.rs +54 -0
- data/bridge/sdk-core/tests/integ_tests/workflow_tests/local_activities.rs +634 -0
- data/bridge/sdk-core/tests/integ_tests/workflow_tests/patches.rs +113 -0
- data/bridge/sdk-core/tests/integ_tests/workflow_tests/replay.rs +137 -0
- data/bridge/sdk-core/tests/integ_tests/workflow_tests/resets.rs +93 -0
- data/bridge/sdk-core/tests/integ_tests/workflow_tests/signals.rs +167 -0
- data/bridge/sdk-core/tests/integ_tests/workflow_tests/stickyness.rs +99 -0
- data/bridge/sdk-core/tests/integ_tests/workflow_tests/timers.rs +131 -0
- data/bridge/sdk-core/tests/integ_tests/workflow_tests/upsert_search_attrs.rs +75 -0
- data/bridge/sdk-core/tests/integ_tests/workflow_tests.rs +587 -0
- data/bridge/sdk-core/tests/load_tests.rs +191 -0
- data/bridge/sdk-core/tests/main.rs +111 -0
- data/bridge/sdk-core/tests/runner.rs +93 -0
- data/bridge/src/connection.rs +167 -0
- data/bridge/src/lib.rs +180 -0
- data/bridge/src/runtime.rs +47 -0
- data/bridge/src/worker.rs +73 -0
- data/ext/Rakefile +9 -0
- data/lib/bridge.so +0 -0
- data/lib/gen/dependencies/gogoproto/gogo_pb.rb +14 -0
- data/lib/gen/temporal/api/batch/v1/message_pb.rb +48 -0
- data/lib/gen/temporal/api/cluster/v1/message_pb.rb +67 -0
- data/lib/gen/temporal/api/command/v1/message_pb.rb +166 -0
- data/lib/gen/temporal/api/common/v1/message_pb.rb +69 -0
- data/lib/gen/temporal/api/enums/v1/batch_operation_pb.rb +32 -0
- data/lib/gen/temporal/api/enums/v1/cluster_pb.rb +26 -0
- data/lib/gen/temporal/api/enums/v1/command_type_pb.rb +37 -0
- data/lib/gen/temporal/api/enums/v1/common_pb.rb +41 -0
- data/lib/gen/temporal/api/enums/v1/event_type_pb.rb +67 -0
- data/lib/gen/temporal/api/enums/v1/failed_cause_pb.rb +71 -0
- data/lib/gen/temporal/api/enums/v1/namespace_pb.rb +37 -0
- data/lib/gen/temporal/api/enums/v1/query_pb.rb +31 -0
- data/lib/gen/temporal/api/enums/v1/reset_pb.rb +24 -0
- data/lib/gen/temporal/api/enums/v1/schedule_pb.rb +28 -0
- data/lib/gen/temporal/api/enums/v1/task_queue_pb.rb +30 -0
- data/lib/gen/temporal/api/enums/v1/update_pb.rb +28 -0
- data/lib/gen/temporal/api/enums/v1/workflow_pb.rb +89 -0
- data/lib/gen/temporal/api/errordetails/v1/message_pb.rb +84 -0
- data/lib/gen/temporal/api/failure/v1/message_pb.rb +83 -0
- data/lib/gen/temporal/api/filter/v1/message_pb.rb +40 -0
- data/lib/gen/temporal/api/history/v1/message_pb.rb +489 -0
- data/lib/gen/temporal/api/namespace/v1/message_pb.rb +63 -0
- data/lib/gen/temporal/api/operatorservice/v1/request_response_pb.rb +125 -0
- data/lib/gen/temporal/api/operatorservice/v1/service_pb.rb +20 -0
- data/lib/gen/temporal/api/query/v1/message_pb.rb +38 -0
- data/lib/gen/temporal/api/replication/v1/message_pb.rb +37 -0
- data/lib/gen/temporal/api/schedule/v1/message_pb.rb +128 -0
- data/lib/gen/temporal/api/taskqueue/v1/message_pb.rb +73 -0
- data/lib/gen/temporal/api/update/v1/message_pb.rb +26 -0
- data/lib/gen/temporal/api/version/v1/message_pb.rb +41 -0
- data/lib/gen/temporal/api/workflow/v1/message_pb.rb +110 -0
- data/lib/gen/temporal/api/workflowservice/v1/request_response_pb.rb +771 -0
- data/lib/gen/temporal/api/workflowservice/v1/service_pb.rb +20 -0
- data/lib/gen/temporal/sdk/core/activity_result/activity_result_pb.rb +58 -0
- data/lib/gen/temporal/sdk/core/activity_task/activity_task_pb.rb +57 -0
- data/lib/gen/temporal/sdk/core/bridge/bridge_pb.rb +222 -0
- data/lib/gen/temporal/sdk/core/child_workflow/child_workflow_pb.rb +57 -0
- data/lib/gen/temporal/sdk/core/common/common_pb.rb +22 -0
- data/lib/gen/temporal/sdk/core/core_interface_pb.rb +34 -0
- data/lib/gen/temporal/sdk/core/external_data/external_data_pb.rb +27 -0
- data/lib/gen/temporal/sdk/core/workflow_activation/workflow_activation_pb.rb +164 -0
- data/lib/gen/temporal/sdk/core/workflow_commands/workflow_commands_pb.rb +192 -0
- data/lib/gen/temporal/sdk/core/workflow_completion/workflow_completion_pb.rb +34 -0
- data/lib/temporal/bridge.rb +14 -0
- data/lib/temporal/client/implementation.rb +339 -0
- data/lib/temporal/client/workflow_handle.rb +243 -0
- data/lib/temporal/client.rb +144 -0
- data/lib/temporal/connection.rb +736 -0
- data/lib/temporal/data_converter.rb +150 -0
- data/lib/temporal/error/failure.rb +194 -0
- data/lib/temporal/error/workflow_failure.rb +17 -0
- data/lib/temporal/errors.rb +22 -0
- data/lib/temporal/failure_converter/base.rb +26 -0
- data/lib/temporal/failure_converter/basic.rb +313 -0
- data/lib/temporal/failure_converter.rb +8 -0
- data/lib/temporal/interceptor/chain.rb +27 -0
- data/lib/temporal/interceptor/client.rb +102 -0
- data/lib/temporal/payload_codec/base.rb +32 -0
- data/lib/temporal/payload_converter/base.rb +24 -0
- data/lib/temporal/payload_converter/bytes.rb +26 -0
- data/lib/temporal/payload_converter/composite.rb +47 -0
- data/lib/temporal/payload_converter/encoding_base.rb +35 -0
- data/lib/temporal/payload_converter/json.rb +25 -0
- data/lib/temporal/payload_converter/nil.rb +25 -0
- data/lib/temporal/payload_converter.rb +14 -0
- data/lib/temporal/retry_policy.rb +82 -0
- data/lib/temporal/retry_state.rb +35 -0
- data/lib/temporal/runtime.rb +22 -0
- data/lib/temporal/timeout_type.rb +29 -0
- data/lib/temporal/version.rb +1 -1
- data/lib/temporal/workflow/execution_info.rb +54 -0
- data/lib/temporal/workflow/execution_status.rb +36 -0
- data/lib/temporal/workflow/id_reuse_policy.rb +36 -0
- data/lib/temporal/workflow/query_reject_condition.rb +33 -0
- data/lib/temporal.rb +4 -0
- data/lib/temporalio.rb +3 -1
- data/lib/thermite_patch.rb +23 -0
- data/temporalio.gemspec +41 -0
- metadata +543 -9
- data/temporal.gemspec +0 -20
@@ -0,0 +1,401 @@
|
|
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.workflowservice.v1;
|
26
|
+
|
27
|
+
option go_package = "go.temporal.io/api/workflowservice/v1;workflowservice";
|
28
|
+
option java_package = "io.temporal.api.workflowservice.v1";
|
29
|
+
option java_multiple_files = true;
|
30
|
+
option java_outer_classname = "ServiceProto";
|
31
|
+
option ruby_package = "Temporal::Api::WorkflowService::V1";
|
32
|
+
option csharp_namespace = "Temporal.Api.WorkflowService.V1";
|
33
|
+
|
34
|
+
|
35
|
+
import "temporal/api/workflowservice/v1/request_response.proto";
|
36
|
+
|
37
|
+
// WorkflowService API defines how Temporal SDKs and other clients interact with the Temporal server
|
38
|
+
// to create and interact with workflows and activities.
|
39
|
+
//
|
40
|
+
// Users are expected to call `StartWorkflowExecution` to create a new workflow execution.
|
41
|
+
//
|
42
|
+
// To drive workflows, a worker using a Temporal SDK must exist which regularly polls for workflow
|
43
|
+
// and activity tasks from the service. For each workflow task, the sdk must process the
|
44
|
+
// (incremental or complete) event history and respond back with any newly generated commands.
|
45
|
+
//
|
46
|
+
// For each activity task, the worker is expected to execute the user's code which implements that
|
47
|
+
// activity, responding with completion or failure.
|
48
|
+
service WorkflowService {
|
49
|
+
|
50
|
+
// RegisterNamespace creates a new namespace which can be used as a container for all resources.
|
51
|
+
//
|
52
|
+
// A Namespace is a top level entity within Temporal, and is used as a container for resources
|
53
|
+
// like workflow executions, task queues, etc. A Namespace acts as a sandbox and provides
|
54
|
+
// isolation for all resources within the namespace. All resources belongs to exactly one
|
55
|
+
// namespace.
|
56
|
+
rpc RegisterNamespace (RegisterNamespaceRequest) returns (RegisterNamespaceResponse) {
|
57
|
+
}
|
58
|
+
|
59
|
+
// DescribeNamespace returns the information and configuration for a registered namespace.
|
60
|
+
rpc DescribeNamespace (DescribeNamespaceRequest) returns (DescribeNamespaceResponse) {
|
61
|
+
}
|
62
|
+
|
63
|
+
// ListNamespaces returns the information and configuration for all namespaces.
|
64
|
+
rpc ListNamespaces (ListNamespacesRequest) returns (ListNamespacesResponse) {
|
65
|
+
}
|
66
|
+
|
67
|
+
// UpdateNamespace is used to update the information and configuration of a registered
|
68
|
+
// namespace.
|
69
|
+
//
|
70
|
+
// (-- api-linter: core::0134::method-signature=disabled
|
71
|
+
// aip.dev/not-precedent: UpdateNamespace RPC doesn't follow Google API format. --)
|
72
|
+
// (-- api-linter: core::0134::response-message-name=disabled
|
73
|
+
// aip.dev/not-precedent: UpdateNamespace RPC doesn't follow Google API format. --)
|
74
|
+
rpc UpdateNamespace (UpdateNamespaceRequest) returns (UpdateNamespaceResponse) {
|
75
|
+
}
|
76
|
+
|
77
|
+
// DeprecateNamespace is used to update the state of a registered namespace to DEPRECATED.
|
78
|
+
//
|
79
|
+
// Once the namespace is deprecated it cannot be used to start new workflow executions. Existing
|
80
|
+
// workflow executions will continue to run on deprecated namespaces.
|
81
|
+
// Deprecated.
|
82
|
+
rpc DeprecateNamespace (DeprecateNamespaceRequest) returns (DeprecateNamespaceResponse) {
|
83
|
+
}
|
84
|
+
|
85
|
+
// StartWorkflowExecution starts a new workflow execution.
|
86
|
+
//
|
87
|
+
// It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and
|
88
|
+
// also schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an
|
89
|
+
// instance already exists with same workflow id.
|
90
|
+
rpc StartWorkflowExecution (StartWorkflowExecutionRequest) returns (StartWorkflowExecutionResponse) {
|
91
|
+
}
|
92
|
+
|
93
|
+
// GetWorkflowExecutionHistory returns the history of specified workflow execution. Fails with
|
94
|
+
// `NotFound` if the specified workflow execution is unknown to the service.
|
95
|
+
rpc GetWorkflowExecutionHistory (GetWorkflowExecutionHistoryRequest) returns (GetWorkflowExecutionHistoryResponse) {
|
96
|
+
}
|
97
|
+
|
98
|
+
// GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse
|
99
|
+
// order (starting from last event). Fails with`NotFound` if the specified workflow execution is
|
100
|
+
// unknown to the service.
|
101
|
+
rpc GetWorkflowExecutionHistoryReverse (GetWorkflowExecutionHistoryReverseRequest) returns (GetWorkflowExecutionHistoryReverseResponse) {
|
102
|
+
}
|
103
|
+
|
104
|
+
// PollWorkflowTaskQueue is called by workers to make progress on workflows.
|
105
|
+
//
|
106
|
+
// A WorkflowTask is dispatched to callers for active workflow executions with pending workflow
|
107
|
+
// tasks. The worker is expected to call `RespondWorkflowTaskCompleted` when it is done
|
108
|
+
// processing the task. The service will create a `WorkflowTaskStarted` event in the history for
|
109
|
+
// this task before handing it to the worker.
|
110
|
+
rpc PollWorkflowTaskQueue (PollWorkflowTaskQueueRequest) returns (PollWorkflowTaskQueueResponse) {
|
111
|
+
}
|
112
|
+
|
113
|
+
// RespondWorkflowTaskCompleted is called by workers to successfully complete workflow tasks
|
114
|
+
// they received from `PollWorkflowTaskQueue`.
|
115
|
+
//
|
116
|
+
// Completing a WorkflowTask will write a `WORKFLOW_TASK_COMPLETED` event to the workflow's
|
117
|
+
// history, along with events corresponding to whatever commands the SDK generated while
|
118
|
+
// executing the task (ex timer started, activity task scheduled, etc).
|
119
|
+
rpc RespondWorkflowTaskCompleted (RespondWorkflowTaskCompletedRequest) returns (RespondWorkflowTaskCompletedResponse) {
|
120
|
+
}
|
121
|
+
|
122
|
+
// RespondWorkflowTaskFailed is called by workers to indicate the processing of a workflow task
|
123
|
+
// failed.
|
124
|
+
//
|
125
|
+
// This results in a `WORKFLOW_TASK_FAILED` event written to the history, and a new workflow
|
126
|
+
// task will be scheduled. This API can be used to report unhandled failures resulting from
|
127
|
+
// applying the workflow task.
|
128
|
+
//
|
129
|
+
// Temporal will only append first WorkflowTaskFailed event to the history of workflow execution
|
130
|
+
// for consecutive failures.
|
131
|
+
rpc RespondWorkflowTaskFailed (RespondWorkflowTaskFailedRequest) returns (RespondWorkflowTaskFailedResponse) {
|
132
|
+
}
|
133
|
+
|
134
|
+
// PollActivityTaskQueue is called by workers to process activity tasks from a specific task
|
135
|
+
// queue.
|
136
|
+
//
|
137
|
+
// The worker is expected to call one of the `RespondActivityTaskXXX` methods when it is done
|
138
|
+
// processing the task.
|
139
|
+
//
|
140
|
+
// An activity task is dispatched whenever a `SCHEDULE_ACTIVITY_TASK` command is produced during
|
141
|
+
// workflow execution. An in memory `ACTIVITY_TASK_STARTED` event is written to mutable state
|
142
|
+
// before the task is dispatched to the worker. The started event, and the final event
|
143
|
+
// (`ACTIVITY_TASK_COMPLETED` / `ACTIVITY_TASK_FAILED` / `ACTIVITY_TASK_TIMED_OUT`) will both be
|
144
|
+
// written permanently to Workflow execution history when Activity is finished. This is done to
|
145
|
+
// avoid writing many events in the case of a failure/retry loop.
|
146
|
+
rpc PollActivityTaskQueue (PollActivityTaskQueueRequest) returns (PollActivityTaskQueueResponse) {
|
147
|
+
}
|
148
|
+
|
149
|
+
// RecordActivityTaskHeartbeat is optionally called by workers while they execute activities.
|
150
|
+
//
|
151
|
+
// If worker fails to heartbeat within the `heartbeat_timeout` interval for the activity task,
|
152
|
+
// then it will be marked as timed out and an `ACTIVITY_TASK_TIMED_OUT` event will be written to
|
153
|
+
// the workflow history. Calling `RecordActivityTaskHeartbeat` will fail with `NotFound` in
|
154
|
+
// such situations, in that event, the SDK should request cancellation of the activity.
|
155
|
+
rpc RecordActivityTaskHeartbeat (RecordActivityTaskHeartbeatRequest) returns (RecordActivityTaskHeartbeatResponse) {
|
156
|
+
}
|
157
|
+
|
158
|
+
// See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by
|
159
|
+
// namespace/workflow id/activity id instead of task token.
|
160
|
+
//
|
161
|
+
// (-- api-linter: core::0136::prepositions=disabled
|
162
|
+
// aip.dev/not-precedent: "By" is used to indicate request type. --)
|
163
|
+
rpc RecordActivityTaskHeartbeatById (RecordActivityTaskHeartbeatByIdRequest) returns (RecordActivityTaskHeartbeatByIdResponse) {
|
164
|
+
}
|
165
|
+
|
166
|
+
// RespondActivityTaskCompleted is called by workers when they successfully complete an activity
|
167
|
+
// task.
|
168
|
+
//
|
169
|
+
// This results in a new `ACTIVITY_TASK_COMPLETED` event being written to the workflow history
|
170
|
+
// and a new workflow task created for the workflow. Fails with `NotFound` if the task token is
|
171
|
+
// no longer valid due to activity timeout, already being completed, or never having existed.
|
172
|
+
rpc RespondActivityTaskCompleted (RespondActivityTaskCompletedRequest) returns (RespondActivityTaskCompletedResponse) {
|
173
|
+
}
|
174
|
+
|
175
|
+
// See `RecordActivityTaskCompleted`. This version allows clients to record completions by
|
176
|
+
// namespace/workflow id/activity id instead of task token.
|
177
|
+
//
|
178
|
+
// (-- api-linter: core::0136::prepositions=disabled
|
179
|
+
// aip.dev/not-precedent: "By" is used to indicate request type. --)
|
180
|
+
rpc RespondActivityTaskCompletedById (RespondActivityTaskCompletedByIdRequest) returns (RespondActivityTaskCompletedByIdResponse) {
|
181
|
+
}
|
182
|
+
|
183
|
+
// RespondActivityTaskFailed is called by workers when processing an activity task fails.
|
184
|
+
//
|
185
|
+
// This results in a new `ACTIVITY_TASK_FAILED` event being written to the workflow history and
|
186
|
+
// a new workflow task created for the workflow. Fails with `NotFound` if the task token is no
|
187
|
+
// longer valid due to activity timeout, already being completed, or never having existed.
|
188
|
+
rpc RespondActivityTaskFailed (RespondActivityTaskFailedRequest) returns (RespondActivityTaskFailedResponse) {
|
189
|
+
}
|
190
|
+
|
191
|
+
// See `RecordActivityTaskFailed`. This version allows clients to record failures by
|
192
|
+
// namespace/workflow id/activity id instead of task token.
|
193
|
+
//
|
194
|
+
// (-- api-linter: core::0136::prepositions=disabled
|
195
|
+
// aip.dev/not-precedent: "By" is used to indicate request type. --)
|
196
|
+
rpc RespondActivityTaskFailedById (RespondActivityTaskFailedByIdRequest) returns (RespondActivityTaskFailedByIdResponse) {
|
197
|
+
}
|
198
|
+
|
199
|
+
// RespondActivityTaskFailed is called by workers when processing an activity task fails.
|
200
|
+
//
|
201
|
+
// This results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history
|
202
|
+
// and a new workflow task created for the workflow. Fails with `NotFound` if the task token is
|
203
|
+
// no longer valid due to activity timeout, already being completed, or never having existed.
|
204
|
+
rpc RespondActivityTaskCanceled (RespondActivityTaskCanceledRequest) returns (RespondActivityTaskCanceledResponse) {
|
205
|
+
}
|
206
|
+
|
207
|
+
// See `RecordActivityTaskCanceled`. This version allows clients to record failures by
|
208
|
+
// namespace/workflow id/activity id instead of task token.
|
209
|
+
//
|
210
|
+
// (-- api-linter: core::0136::prepositions=disabled
|
211
|
+
// aip.dev/not-precedent: "By" is used to indicate request type. --)
|
212
|
+
rpc RespondActivityTaskCanceledById (RespondActivityTaskCanceledByIdRequest) returns (RespondActivityTaskCanceledByIdResponse) {
|
213
|
+
}
|
214
|
+
|
215
|
+
// RequestCancelWorkflowExecution is called by workers when they want to request cancellation of
|
216
|
+
// a workflow execution.
|
217
|
+
//
|
218
|
+
// This results in a new `WORKFLOW_EXECUTION_CANCEL_REQUESTED` event being written to the
|
219
|
+
// workflow history and a new workflow task created for the workflow. It returns success if the requested
|
220
|
+
// workflow is already closed. It fails with 'NotFound' if the requested workflow doesn't exist.
|
221
|
+
rpc RequestCancelWorkflowExecution (RequestCancelWorkflowExecutionRequest) returns (RequestCancelWorkflowExecutionResponse) {
|
222
|
+
}
|
223
|
+
|
224
|
+
// SignalWorkflowExecution is used to send a signal to a running workflow execution.
|
225
|
+
//
|
226
|
+
// This results in a `WORKFLOW_EXECUTION_SIGNALED` event recorded in the history and a workflow
|
227
|
+
// task being created for the execution.
|
228
|
+
rpc SignalWorkflowExecution (SignalWorkflowExecutionRequest) returns (SignalWorkflowExecutionResponse) {
|
229
|
+
}
|
230
|
+
|
231
|
+
// SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if
|
232
|
+
// it isn't yet started.
|
233
|
+
//
|
234
|
+
// If the workflow is running, a `WORKFLOW_EXECUTION_SIGNALED` event is recorded in the history
|
235
|
+
// and a workflow task is generated.
|
236
|
+
//
|
237
|
+
// If the workflow is not running or not found, then the workflow is created with
|
238
|
+
// `WORKFLOW_EXECUTION_STARTED` and `WORKFLOW_EXECUTION_SIGNALED` events in its history, and a
|
239
|
+
// workflow task is generated.
|
240
|
+
//
|
241
|
+
// (-- api-linter: core::0136::prepositions=disabled
|
242
|
+
// aip.dev/not-precedent: "With" is used to indicate combined operation. --)
|
243
|
+
rpc SignalWithStartWorkflowExecution (SignalWithStartWorkflowExecutionRequest) returns (SignalWithStartWorkflowExecutionResponse) {
|
244
|
+
}
|
245
|
+
|
246
|
+
// ResetWorkflowExecution will reset an existing workflow execution to a specified
|
247
|
+
// `WORKFLOW_TASK_COMPLETED` event (exclusive). It will immediately terminate the current
|
248
|
+
// execution instance.
|
249
|
+
// TODO: Does exclusive here mean *just* the completed event, or also WFT started? Otherwise the task is doomed to time out?
|
250
|
+
rpc ResetWorkflowExecution (ResetWorkflowExecutionRequest) returns (ResetWorkflowExecutionResponse) {
|
251
|
+
}
|
252
|
+
|
253
|
+
// TerminateWorkflowExecution terminates an existing workflow execution by recording a
|
254
|
+
// `WORKFLOW_EXECUTION_TERMINATED` event in the history and immediately terminating the
|
255
|
+
// execution instance.
|
256
|
+
rpc TerminateWorkflowExecution (TerminateWorkflowExecutionRequest) returns (TerminateWorkflowExecutionResponse) {
|
257
|
+
}
|
258
|
+
|
259
|
+
// ListOpenWorkflowExecutions is a visibility API to list the open executions in a specific namespace.
|
260
|
+
rpc ListOpenWorkflowExecutions (ListOpenWorkflowExecutionsRequest) returns (ListOpenWorkflowExecutionsResponse) {
|
261
|
+
}
|
262
|
+
|
263
|
+
// ListClosedWorkflowExecutions is a visibility API to list the closed executions in a specific namespace.
|
264
|
+
rpc ListClosedWorkflowExecutions (ListClosedWorkflowExecutionsRequest) returns (ListClosedWorkflowExecutionsResponse) {
|
265
|
+
}
|
266
|
+
|
267
|
+
// ListWorkflowExecutions is a visibility API to list workflow executions in a specific namespace.
|
268
|
+
rpc ListWorkflowExecutions (ListWorkflowExecutionsRequest) returns (ListWorkflowExecutionsResponse) {
|
269
|
+
}
|
270
|
+
|
271
|
+
// ListArchivedWorkflowExecutions is a visibility API to list archived workflow executions in a specific namespace.
|
272
|
+
rpc ListArchivedWorkflowExecutions (ListArchivedWorkflowExecutionsRequest) returns (ListArchivedWorkflowExecutionsResponse) {
|
273
|
+
}
|
274
|
+
|
275
|
+
// ScanWorkflowExecutions is a visibility API to list large amount of workflow executions in a specific namespace without order.
|
276
|
+
rpc ScanWorkflowExecutions (ScanWorkflowExecutionsRequest) returns (ScanWorkflowExecutionsResponse) {
|
277
|
+
}
|
278
|
+
|
279
|
+
// CountWorkflowExecutions is a visibility API to count of workflow executions in a specific namespace.
|
280
|
+
rpc CountWorkflowExecutions (CountWorkflowExecutionsRequest) returns (CountWorkflowExecutionsResponse) {
|
281
|
+
}
|
282
|
+
|
283
|
+
// GetSearchAttributes is a visibility API to get all legal keys that could be used in list APIs
|
284
|
+
rpc GetSearchAttributes (GetSearchAttributesRequest) returns (GetSearchAttributesResponse) {
|
285
|
+
}
|
286
|
+
|
287
|
+
// RespondQueryTaskCompleted is called by workers to complete queries which were delivered on
|
288
|
+
// the `query` (not `queries`) field of a `PollWorkflowTaskQueueResponse`.
|
289
|
+
//
|
290
|
+
// Completing the query will unblock the corresponding client call to `QueryWorkflow` and return
|
291
|
+
// the query result a response.
|
292
|
+
rpc RespondQueryTaskCompleted (RespondQueryTaskCompletedRequest) returns (RespondQueryTaskCompletedResponse) {
|
293
|
+
}
|
294
|
+
|
295
|
+
// ResetStickyTaskQueue resets the sticky task queue related information in the mutable state of
|
296
|
+
// a given workflow. This is prudent for workers to perform if a workflow has been paged out of
|
297
|
+
// their cache.
|
298
|
+
//
|
299
|
+
// Things cleared are:
|
300
|
+
// 1. StickyTaskQueue
|
301
|
+
// 2. StickyScheduleToStartTimeout
|
302
|
+
rpc ResetStickyTaskQueue (ResetStickyTaskQueueRequest) returns (ResetStickyTaskQueueResponse) {
|
303
|
+
}
|
304
|
+
|
305
|
+
// QueryWorkflow requests a query be executed for a specified workflow execution.
|
306
|
+
rpc QueryWorkflow (QueryWorkflowRequest) returns (QueryWorkflowResponse) {
|
307
|
+
}
|
308
|
+
|
309
|
+
// DescribeWorkflowExecution returns information about the specified workflow execution.
|
310
|
+
rpc DescribeWorkflowExecution (DescribeWorkflowExecutionRequest) returns (DescribeWorkflowExecutionResponse) {
|
311
|
+
}
|
312
|
+
|
313
|
+
// DescribeTaskQueue returns information about the target task queue.
|
314
|
+
rpc DescribeTaskQueue (DescribeTaskQueueRequest) returns (DescribeTaskQueueResponse) {
|
315
|
+
}
|
316
|
+
|
317
|
+
// GetClusterInfo returns information about temporal cluster
|
318
|
+
rpc GetClusterInfo(GetClusterInfoRequest) returns (GetClusterInfoResponse){
|
319
|
+
}
|
320
|
+
|
321
|
+
// GetSystemInfo returns information about the system.
|
322
|
+
rpc GetSystemInfo(GetSystemInfoRequest) returns (GetSystemInfoResponse) {
|
323
|
+
}
|
324
|
+
|
325
|
+
rpc ListTaskQueuePartitions(ListTaskQueuePartitionsRequest) returns (ListTaskQueuePartitionsResponse) {
|
326
|
+
}
|
327
|
+
|
328
|
+
// Creates a new schedule.
|
329
|
+
// (-- api-linter: core::0133::method-signature=disabled
|
330
|
+
// aip.dev/not-precedent: CreateSchedule doesn't follow Google API format --)
|
331
|
+
// (-- api-linter: core::0133::response-message-name=disabled
|
332
|
+
// aip.dev/not-precedent: CreateSchedule doesn't follow Google API format --)
|
333
|
+
// (-- api-linter: core::0133::http-uri-parent=disabled
|
334
|
+
// aip.dev/not-precedent: CreateSchedule doesn't follow Google API format --)
|
335
|
+
rpc CreateSchedule (CreateScheduleRequest) returns (CreateScheduleResponse) {
|
336
|
+
}
|
337
|
+
|
338
|
+
// Returns the schedule description and current state of an existing schedule.
|
339
|
+
rpc DescribeSchedule (DescribeScheduleRequest) returns (DescribeScheduleResponse) {
|
340
|
+
}
|
341
|
+
|
342
|
+
// Changes the configuration or state of an existing schedule.
|
343
|
+
// (-- api-linter: core::0134::response-message-name=disabled
|
344
|
+
// aip.dev/not-precedent: UpdateSchedule RPC doesn't follow Google API format. --)
|
345
|
+
// (-- api-linter: core::0134::method-signature=disabled
|
346
|
+
// aip.dev/not-precedent: UpdateSchedule RPC doesn't follow Google API format. --)
|
347
|
+
rpc UpdateSchedule (UpdateScheduleRequest) returns (UpdateScheduleResponse) {
|
348
|
+
}
|
349
|
+
|
350
|
+
// Makes a specific change to a schedule or triggers an immediate action.
|
351
|
+
// (-- api-linter: core::0134::synonyms=disabled
|
352
|
+
// aip.dev/not-precedent: we have both patch and update. --)
|
353
|
+
rpc PatchSchedule (PatchScheduleRequest) returns (PatchScheduleResponse) {
|
354
|
+
}
|
355
|
+
|
356
|
+
// Lists matching times within a range.
|
357
|
+
rpc ListScheduleMatchingTimes (ListScheduleMatchingTimesRequest) returns (ListScheduleMatchingTimesResponse) {
|
358
|
+
}
|
359
|
+
|
360
|
+
// Deletes a schedule, removing it from the system.
|
361
|
+
// (-- api-linter: core::0135::method-signature=disabled
|
362
|
+
// aip.dev/not-precedent: DeleteSchedule doesn't follow Google API format --)
|
363
|
+
// (-- api-linter: core::0135::response-message-name=disabled
|
364
|
+
// aip.dev/not-precedent: DeleteSchedule doesn't follow Google API format --)
|
365
|
+
rpc DeleteSchedule (DeleteScheduleRequest) returns (DeleteScheduleResponse) {
|
366
|
+
}
|
367
|
+
|
368
|
+
// List all schedules in a namespace.
|
369
|
+
rpc ListSchedules (ListSchedulesRequest) returns (ListSchedulesResponse) {
|
370
|
+
}
|
371
|
+
|
372
|
+
// (-- api-linter: core::0134::response-message-name=disabled
|
373
|
+
// aip.dev/not-precedent: UpdateWorkerBuildIdOrdering RPC doesn't follow Google API format. --)
|
374
|
+
// (-- api-linter: core::0134::method-signature=disabled
|
375
|
+
// aip.dev/not-precedent: UpdateWorkerBuildIdOrdering RPC doesn't follow Google API format. --)
|
376
|
+
rpc UpdateWorkerBuildIdOrdering (UpdateWorkerBuildIdOrderingRequest) returns (UpdateWorkerBuildIdOrderingResponse) {}
|
377
|
+
// This could / maybe should just be part of `DescribeTaskQueue`, but is broken out here to show easily.
|
378
|
+
rpc GetWorkerBuildIdOrdering (GetWorkerBuildIdOrderingRequest) returns (GetWorkerBuildIdOrderingResponse) {}
|
379
|
+
|
380
|
+
// Invokes the specified update function on user workflow code.
|
381
|
+
// (-- api-linter: core::0134=disabled
|
382
|
+
// aip.dev/not-precedent: UpdateWorkflow doesn't follow Google API format --)
|
383
|
+
rpc UpdateWorkflow(UpdateWorkflowRequest) returns (UpdateWorkflowResponse) {
|
384
|
+
}
|
385
|
+
|
386
|
+
// StartBatchOperation starts a new batch operation
|
387
|
+
rpc StartBatchOperation(StartBatchOperationRequest) returns (StartBatchOperationResponse) {
|
388
|
+
}
|
389
|
+
|
390
|
+
// StopBatchOperation stops a batch operation
|
391
|
+
rpc StopBatchOperation(StopBatchOperationRequest) returns (StopBatchOperationResponse) {
|
392
|
+
}
|
393
|
+
|
394
|
+
// DescribeBatchOperation returns the information about a batch operation
|
395
|
+
rpc DescribeBatchOperation(DescribeBatchOperationRequest) returns (DescribeBatchOperationResponse) {
|
396
|
+
}
|
397
|
+
|
398
|
+
// ListBatchOperations returns a list of batch operations
|
399
|
+
rpc ListBatchOperations(ListBatchOperationsRequest) returns (ListBatchOperationsResponse) {
|
400
|
+
}
|
401
|
+
}
|
@@ -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
|
+
}
|
@@ -0,0 +1,78 @@
|
|
1
|
+
syntax = "proto3";
|
2
|
+
|
3
|
+
package coresdk.activity_result;
|
4
|
+
|
5
|
+
import "google/protobuf/duration.proto";
|
6
|
+
import "google/protobuf/timestamp.proto";
|
7
|
+
import "temporal/api/common/v1/message.proto";
|
8
|
+
import "temporal/api/failure/v1/message.proto";
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Used to report activity completions to core
|
12
|
+
*/
|
13
|
+
message ActivityExecutionResult {
|
14
|
+
oneof status {
|
15
|
+
Success completed = 1;
|
16
|
+
Failure failed = 2;
|
17
|
+
Cancellation cancelled = 3;
|
18
|
+
WillCompleteAsync will_complete_async = 4;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
// Used to report activity resolutions to lang. IE: This is what the activities are resolved with
|
23
|
+
// in the workflow.
|
24
|
+
message ActivityResolution {
|
25
|
+
oneof status {
|
26
|
+
Success completed = 1;
|
27
|
+
Failure failed = 2;
|
28
|
+
Cancellation cancelled = 3;
|
29
|
+
DoBackoff backoff = 4;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
/** Used to report successful completion either when executing or resolving */
|
34
|
+
message Success {
|
35
|
+
temporal.api.common.v1.Payload result = 1;
|
36
|
+
}
|
37
|
+
|
38
|
+
/** Used to report activity failure either when executing or resolving */
|
39
|
+
message Failure {
|
40
|
+
temporal.api.failure.v1.Failure failure = 1;
|
41
|
+
}
|
42
|
+
|
43
|
+
/**
|
44
|
+
* Used to report cancellation from both Core and Lang.
|
45
|
+
* When Lang reports a cancelled activity, it must put a CancelledFailure in the failure field.
|
46
|
+
* When Core reports a cancelled activity, it must put an ActivityFailure with CancelledFailure
|
47
|
+
* as the cause in the failure field.
|
48
|
+
*/
|
49
|
+
message Cancellation {
|
50
|
+
temporal.api.failure.v1.Failure failure = 1;
|
51
|
+
}
|
52
|
+
|
53
|
+
/**
|
54
|
+
* Used in ActivityExecutionResult to notify Core that this Activity will complete asynchronously.
|
55
|
+
* Core will forget about this Activity and free up resources used to track this Activity.
|
56
|
+
*/
|
57
|
+
message WillCompleteAsync {
|
58
|
+
}
|
59
|
+
|
60
|
+
/**
|
61
|
+
* Issued when a local activity needs to retry but also wants to back off more than would be
|
62
|
+
* reasonable to WFT heartbeat for. Lang is expected to schedule a timer for the duration
|
63
|
+
* and then start a local activity of the same type & same inputs with the provided attempt number
|
64
|
+
* after the timer has elapsed.
|
65
|
+
*
|
66
|
+
* This exists because Core does not have a concept of starting commands by itself, they originate
|
67
|
+
* from lang. So expecting lang to start the timer / next pass of the activity fits more smoothly.
|
68
|
+
*/
|
69
|
+
message DoBackoff {
|
70
|
+
// The attempt number that lang should provide when scheduling the retry. If the LA failed
|
71
|
+
// on attempt 4 and we told lang to back off with a timer, this number will be 5.
|
72
|
+
uint32 attempt = 1;
|
73
|
+
google.protobuf.Duration backoff_duration = 2;
|
74
|
+
// The time the first attempt of this local activity was scheduled. Must be passed with attempt
|
75
|
+
// to the retry LA.
|
76
|
+
google.protobuf.Timestamp original_schedule_time = 3;
|
77
|
+
}
|
78
|
+
|
@@ -0,0 +1,79 @@
|
|
1
|
+
syntax = "proto3";
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Definitions of the different activity tasks returned from [crate::Core::poll_task].
|
5
|
+
*/
|
6
|
+
package coresdk.activity_task;
|
7
|
+
|
8
|
+
import "google/protobuf/duration.proto";
|
9
|
+
import "google/protobuf/timestamp.proto";
|
10
|
+
import "temporal/api/common/v1/message.proto";
|
11
|
+
import "temporal/sdk/core/common/common.proto";
|
12
|
+
|
13
|
+
message ActivityTask {
|
14
|
+
/// A unique identifier for this task
|
15
|
+
bytes task_token = 1;
|
16
|
+
oneof variant {
|
17
|
+
/// Start activity execution.
|
18
|
+
Start start = 3;
|
19
|
+
/// Attempt to cancel activity execution.
|
20
|
+
Cancel cancel = 4;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
// Begin executing an activity
|
25
|
+
message Start {
|
26
|
+
// The namespace the workflow lives in
|
27
|
+
string workflow_namespace = 1;
|
28
|
+
// The workflow's type name or function identifier
|
29
|
+
string workflow_type = 2;
|
30
|
+
// The workflow execution which requested this activity
|
31
|
+
temporal.api.common.v1.WorkflowExecution workflow_execution = 3;
|
32
|
+
// The activity's ID
|
33
|
+
string activity_id = 4;
|
34
|
+
// The activity's type name or function identifier
|
35
|
+
string activity_type = 5;
|
36
|
+
map<string, temporal.api.common.v1.Payload> header_fields = 6;
|
37
|
+
// Arguments to the activity
|
38
|
+
repeated temporal.api.common.v1.Payload input = 7;
|
39
|
+
// The last details that were recorded by a heartbeat when this task was generated
|
40
|
+
repeated temporal.api.common.v1.Payload heartbeat_details = 8;
|
41
|
+
// When the task was *first* scheduled
|
42
|
+
google.protobuf.Timestamp scheduled_time = 9;
|
43
|
+
// When this current attempt at the task was scheduled
|
44
|
+
google.protobuf.Timestamp current_attempt_scheduled_time = 10;
|
45
|
+
// When this attempt was started, which is to say when core received it by polling.
|
46
|
+
google.protobuf.Timestamp started_time = 11;
|
47
|
+
uint32 attempt = 12;
|
48
|
+
|
49
|
+
// Timeout from the first schedule time to completion
|
50
|
+
google.protobuf.Duration schedule_to_close_timeout = 13;
|
51
|
+
// Timeout from starting an attempt to reporting its result
|
52
|
+
google.protobuf.Duration start_to_close_timeout = 14;
|
53
|
+
// If set a heartbeat must be reported within this interval
|
54
|
+
google.protobuf.Duration heartbeat_timeout = 15;
|
55
|
+
// This is an actual retry policy the service uses. It can be different from the one provided
|
56
|
+
// (or not) during activity scheduling as the service can override the provided one in case its
|
57
|
+
// values are not specified or exceed configured system limits.
|
58
|
+
temporal.api.common.v1.RetryPolicy retry_policy = 16;
|
59
|
+
|
60
|
+
// Set to true if this is a local activity. Note that heartbeating does not apply to local
|
61
|
+
// activities.
|
62
|
+
bool is_local = 17;
|
63
|
+
}
|
64
|
+
|
65
|
+
/// Attempt to cancel a running activity
|
66
|
+
message Cancel {
|
67
|
+
ActivityCancelReason reason = 1;
|
68
|
+
}
|
69
|
+
|
70
|
+
enum ActivityCancelReason {
|
71
|
+
/// The activity no longer exists according to server (may be already completed)
|
72
|
+
NOT_FOUND = 0;
|
73
|
+
/// Activity was explicitly cancelled
|
74
|
+
CANCELLED = 1;
|
75
|
+
/// Activity timed out
|
76
|
+
TIMED_OUT = 2;
|
77
|
+
}
|
78
|
+
|
79
|
+
|