temporalio 1.1.0-aarch64-linux → 1.3.0-aarch64-linux
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.
- checksums.yaml +4 -4
- data/Gemfile +6 -4
- data/lib/temporalio/activity/definition.rb +6 -1
- data/lib/temporalio/api/activity/v1/message.rb +11 -2
- data/lib/temporalio/api/command/v1/message.rb +1 -1
- data/lib/temporalio/api/common/v1/message.rb +2 -1
- data/lib/temporalio/api/deployment/v1/message.rb +2 -1
- data/lib/temporalio/api/enums/v1/activity.rb +23 -0
- data/lib/temporalio/api/enums/v1/event_type.rb +1 -1
- data/lib/temporalio/api/enums/v1/failed_cause.rb +1 -1
- data/lib/temporalio/api/enums/v1/task_queue.rb +2 -1
- data/lib/temporalio/api/enums/v1/workflow.rb +3 -1
- data/lib/temporalio/api/errordetails/v1/message.rb +2 -1
- data/lib/temporalio/api/history/v1/message.rb +3 -1
- data/lib/temporalio/api/namespace/v1/message.rb +2 -1
- data/lib/temporalio/api/nexus/v1/message.rb +1 -1
- data/lib/temporalio/api/operatorservice/v1/request_response.rb +1 -1
- data/lib/temporalio/api/payload_visitor.rb +64 -0
- data/lib/temporalio/api/taskqueue/v1/message.rb +1 -1
- data/lib/temporalio/api/worker/v1/message.rb +1 -1
- data/lib/temporalio/api/workflow/v1/message.rb +2 -1
- data/lib/temporalio/api/workflowservice/v1/request_response.rb +23 -1
- data/lib/temporalio/api/workflowservice/v1/service.rb +1 -1
- data/lib/temporalio/client/connection/workflow_service.rb +150 -0
- data/lib/temporalio/client/connection.rb +17 -3
- data/lib/temporalio/client/plugin.rb +42 -0
- data/lib/temporalio/client.rb +82 -15
- data/lib/temporalio/common_enums.rb +0 -2
- data/lib/temporalio/contrib/open_telemetry.rb +21 -0
- data/lib/temporalio/converters/failure_converter.rb +30 -0
- data/lib/temporalio/converters/payload_converter/binary_protobuf.rb +4 -1
- data/lib/temporalio/converters/payload_converter/json_protobuf.rb +4 -1
- data/lib/temporalio/env_config.rb +3 -14
- data/lib/temporalio/error/failure.rb +66 -0
- data/lib/temporalio/internal/bridge/3.3/temporalio_bridge.so +0 -0
- data/lib/temporalio/internal/bridge/3.4/temporalio_bridge.so +0 -0
- data/lib/temporalio/internal/bridge/{3.2 → 4.0}/temporalio_bridge.so +0 -0
- data/lib/temporalio/internal/bridge/api/core_interface.rb +3 -1
- data/lib/temporalio/internal/bridge/api/nexus/nexus.rb +2 -1
- data/lib/temporalio/internal/bridge/api/workflow_commands/workflow_commands.rb +1 -1
- data/lib/temporalio/internal/bridge/worker.rb +1 -0
- data/lib/temporalio/internal/worker/workflow_instance/context.rb +9 -0
- data/lib/temporalio/internal/worker/workflow_instance/externally_immutable_hash.rb +1 -1
- data/lib/temporalio/internal/worker/workflow_instance/handler_hash.rb +1 -1
- data/lib/temporalio/internal/worker/workflow_instance/illegal_call_tracer.rb +8 -4
- data/lib/temporalio/internal/worker/workflow_instance/nexus_client.rb +42 -0
- data/lib/temporalio/internal/worker/workflow_instance/nexus_operation_handle.rb +51 -0
- data/lib/temporalio/internal/worker/workflow_instance/outbound_implementation.rb +100 -11
- data/lib/temporalio/internal/worker/workflow_instance/replay_safe_logger.rb +2 -1
- data/lib/temporalio/internal/worker/workflow_instance/replay_safe_metric.rb +2 -1
- data/lib/temporalio/internal/worker/workflow_instance/scheduler.rb +10 -1
- data/lib/temporalio/internal/worker/workflow_instance.rb +26 -11
- data/lib/temporalio/simple_plugin.rb +192 -0
- data/lib/temporalio/testing/workflow_environment.rb +40 -0
- data/lib/temporalio/version.rb +1 -1
- data/lib/temporalio/versioning_override.rb +0 -2
- data/lib/temporalio/worker/deployment_options.rb +0 -2
- data/lib/temporalio/worker/interceptor.rb +27 -0
- data/lib/temporalio/worker/plugin.rb +88 -0
- data/lib/temporalio/worker/workflow_executor/thread_pool.rb +1 -1
- data/lib/temporalio/worker/workflow_replayer.rb +28 -5
- data/lib/temporalio/worker.rb +116 -43
- data/lib/temporalio/worker_deployment_version.rb +0 -2
- data/lib/temporalio/workflow/definition.rb +3 -4
- data/lib/temporalio/workflow/nexus_client.rb +81 -0
- data/lib/temporalio/workflow/nexus_operation_cancellation_type.rb +21 -0
- data/lib/temporalio/workflow/nexus_operation_handle.rb +37 -0
- data/lib/temporalio/workflow.rb +22 -1
- data/temporalio.gemspec +1 -1
- metadata +14 -5
|
@@ -17,7 +17,7 @@ require 'temporalio/internal/bridge/api/workflow_commands/workflow_commands'
|
|
|
17
17
|
require 'temporalio/internal/bridge/api/workflow_completion/workflow_completion'
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
descriptor_data = "\n&temporal/sdk/core/core_interface.proto\x12\x07\x63oresdk\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a$temporal/api/common/v1/message.proto\x1a\x37temporal/sdk/core/activity_result/activity_result.proto\x1a\x33temporal/sdk/core/activity_task/activity_task.proto\x1a%temporal/sdk/core/common/common.proto\x1a\x33temporal/sdk/core/external_data/external_data.proto\x1a?temporal/sdk/core/workflow_activation/workflow_activation.proto\x1a;temporal/sdk/core/workflow_commands/workflow_commands.proto\x1a?temporal/sdk/core/workflow_completion/workflow_completion.proto\"Y\n\x11\x41\x63tivityHeartbeat\x12\x12\n\ntask_token\x18\x01 \x01(\x0c\x12\x30\n\x07\x64\x65tails\x18\x02 \x03(\x0b\x32\x1f.temporal.api.common.v1.Payload\"n\n\x16\x41\x63tivityTaskCompletion\x12\x12\n\ntask_token\x18\x01 \x01(\x0c\x12@\n\x06result\x18\x02 \x01(\x0b\x32\x30.coresdk.activity_result.ActivityExecutionResult\"<\n\x10WorkflowSlotInfo\x12\x15\n\rworkflow_type\x18\x01 \x01(\t\x12\x11\n\tis_sticky\x18\x02 \x01(\x08\")\n\x10\x41\x63tivitySlotInfo\x12\x15\n\ractivity_type\x18\x01 \x01(\t\".\n\x15LocalActivitySlotInfo\x12\x15\n\ractivity_type\x18\x01 \x01(\t\"3\n\rNexusSlotInfo\x12\x0f\n\x07service\x18\x01 \x01(\t\x12\x11\n\toperation\x18\x02 \x01(\
|
|
20
|
+
descriptor_data = "\n&temporal/sdk/core/core_interface.proto\x12\x07\x63oresdk\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a$temporal/api/common/v1/message.proto\x1a\x37temporal/sdk/core/activity_result/activity_result.proto\x1a\x33temporal/sdk/core/activity_task/activity_task.proto\x1a%temporal/sdk/core/common/common.proto\x1a\x33temporal/sdk/core/external_data/external_data.proto\x1a?temporal/sdk/core/workflow_activation/workflow_activation.proto\x1a;temporal/sdk/core/workflow_commands/workflow_commands.proto\x1a?temporal/sdk/core/workflow_completion/workflow_completion.proto\"Y\n\x11\x41\x63tivityHeartbeat\x12\x12\n\ntask_token\x18\x01 \x01(\x0c\x12\x30\n\x07\x64\x65tails\x18\x02 \x03(\x0b\x32\x1f.temporal.api.common.v1.Payload\"n\n\x16\x41\x63tivityTaskCompletion\x12\x12\n\ntask_token\x18\x01 \x01(\x0c\x12@\n\x06result\x18\x02 \x01(\x0b\x32\x30.coresdk.activity_result.ActivityExecutionResult\"<\n\x10WorkflowSlotInfo\x12\x15\n\rworkflow_type\x18\x01 \x01(\t\x12\x11\n\tis_sticky\x18\x02 \x01(\x08\")\n\x10\x41\x63tivitySlotInfo\x12\x15\n\ractivity_type\x18\x01 \x01(\t\".\n\x15LocalActivitySlotInfo\x12\x15\n\ractivity_type\x18\x01 \x01(\t\"3\n\rNexusSlotInfo\x12\x0f\n\x07service\x18\x01 \x01(\t\x12\x11\n\toperation\x18\x02 \x01(\t\"\x86\x01\n\rNamespaceInfo\x12-\n\x06limits\x18\x01 \x01(\x0b\x32\x1d.coresdk.NamespaceInfo.Limits\x1a\x46\n\x06Limits\x12\x1d\n\x15\x62lob_size_limit_error\x18\x01 \x01(\x03\x12\x1d\n\x15memo_size_limit_error\x18\x02 \x01(\x03\x42\x33\xea\x02\x30Temporalio::Internal::Bridge::Api::CoreInterfaceb\x06proto3"
|
|
21
21
|
|
|
22
22
|
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
|
23
23
|
pool.add_serialized_file(descriptor_data)
|
|
@@ -33,6 +33,8 @@ module Temporalio
|
|
|
33
33
|
ActivitySlotInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("coresdk.ActivitySlotInfo").msgclass
|
|
34
34
|
LocalActivitySlotInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("coresdk.LocalActivitySlotInfo").msgclass
|
|
35
35
|
NexusSlotInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("coresdk.NexusSlotInfo").msgclass
|
|
36
|
+
NamespaceInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("coresdk.NamespaceInfo").msgclass
|
|
37
|
+
NamespaceInfo::Limits = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("coresdk.NamespaceInfo.Limits").msgclass
|
|
36
38
|
end
|
|
37
39
|
end
|
|
38
40
|
end
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
require 'google/protobuf'
|
|
6
6
|
|
|
7
|
+
require 'google/protobuf/timestamp_pb'
|
|
7
8
|
require 'temporalio/api/common/v1/message'
|
|
8
9
|
require 'temporalio/api/failure/v1/message'
|
|
9
10
|
require 'temporalio/api/nexus/v1/message'
|
|
@@ -11,7 +12,7 @@ require 'temporalio/api/workflowservice/v1/request_response'
|
|
|
11
12
|
require 'temporalio/internal/bridge/api/common/common'
|
|
12
13
|
|
|
13
14
|
|
|
14
|
-
descriptor_data = "\n#temporal/sdk/core/nexus/nexus.proto\x12\rcoresdk.nexus\x1a$temporal/api/common/v1/message.proto\x1a%temporal/api/failure/v1/message.proto\x1a#temporal/api/nexus/v1/message.proto\x1a\x36temporal/api/workflowservice/v1/request_response.proto\x1a%temporal/sdk/core/common/common.proto\"\xf8\x01\n\x14NexusOperationResult\x12\x34\n\tcompleted\x18\x01 \x01(\x0b\x32\x1f.temporal.api.common.v1.PayloadH\x00\x12\x32\n\x06\x66\x61iled\x18\x02 \x01(\x0b\x32 .temporal.api.failure.v1.FailureH\x00\x12\x35\n\tcancelled\x18\x03 \x01(\x0b\x32 .temporal.api.failure.v1.FailureH\x00\x12\x35\n\ttimed_out\x18\x04 \x01(\x0b\x32 .temporal.api.failure.v1.FailureH\x00\x42\x08\n\x06status\"\xb5\x01\n\x13NexusTaskCompletion\x12\x12\n\ntask_token\x18\x01 \x01(\x0c\x12\x34\n\tcompleted\x18\x02 \x01(\x0b\x32\x1f.temporal.api.nexus.v1.ResponseH\x00\x12\x34\n\x05\x65rror\x18\x03 \x01(\x0b\x32#.temporal.api.nexus.v1.HandlerErrorH\x00\x12\x14\n\nack_cancel\x18\x04 \x01(\x08H\x00\x42\x08\n\x06status\"\
|
|
15
|
+
descriptor_data = "\n#temporal/sdk/core/nexus/nexus.proto\x12\rcoresdk.nexus\x1a\x1fgoogle/protobuf/timestamp.proto\x1a$temporal/api/common/v1/message.proto\x1a%temporal/api/failure/v1/message.proto\x1a#temporal/api/nexus/v1/message.proto\x1a\x36temporal/api/workflowservice/v1/request_response.proto\x1a%temporal/sdk/core/common/common.proto\"\xf8\x01\n\x14NexusOperationResult\x12\x34\n\tcompleted\x18\x01 \x01(\x0b\x32\x1f.temporal.api.common.v1.PayloadH\x00\x12\x32\n\x06\x66\x61iled\x18\x02 \x01(\x0b\x32 .temporal.api.failure.v1.FailureH\x00\x12\x35\n\tcancelled\x18\x03 \x01(\x0b\x32 .temporal.api.failure.v1.FailureH\x00\x12\x35\n\ttimed_out\x18\x04 \x01(\x0b\x32 .temporal.api.failure.v1.FailureH\x00\x42\x08\n\x06status\"\xb5\x01\n\x13NexusTaskCompletion\x12\x12\n\ntask_token\x18\x01 \x01(\x0c\x12\x34\n\tcompleted\x18\x02 \x01(\x0b\x32\x1f.temporal.api.nexus.v1.ResponseH\x00\x12\x34\n\x05\x65rror\x18\x03 \x01(\x0b\x32#.temporal.api.nexus.v1.HandlerErrorH\x00\x12\x14\n\nack_cancel\x18\x04 \x01(\x08H\x00\x42\x08\n\x06status\"\xd0\x01\n\tNexusTask\x12K\n\x04task\x18\x01 \x01(\x0b\x32;.temporal.api.workflowservice.v1.PollNexusTaskQueueResponseH\x00\x12\x35\n\x0b\x63\x61ncel_task\x18\x02 \x01(\x0b\x32\x1e.coresdk.nexus.CancelNexusTaskH\x00\x12\x34\n\x10request_deadline\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\t\n\x07variant\"[\n\x0f\x43\x61ncelNexusTask\x12\x12\n\ntask_token\x18\x01 \x01(\x0c\x12\x34\n\x06reason\x18\x02 \x01(\x0e\x32$.coresdk.nexus.NexusTaskCancelReason*;\n\x15NexusTaskCancelReason\x12\r\n\tTIMED_OUT\x10\x00\x12\x13\n\x0fWORKER_SHUTDOWN\x10\x01*\x7f\n\x1eNexusOperationCancellationType\x12\x1f\n\x1bWAIT_CANCELLATION_COMPLETED\x10\x00\x12\x0b\n\x07\x41\x42\x41NDON\x10\x01\x12\x0e\n\nTRY_CANCEL\x10\x02\x12\x1f\n\x1bWAIT_CANCELLATION_REQUESTED\x10\x03\x42+\xea\x02(Temporalio::Internal::Bridge::Api::Nexusb\x06proto3"
|
|
15
16
|
|
|
16
17
|
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
|
17
18
|
pool.add_serialized_file(descriptor_data)
|
|
@@ -16,7 +16,7 @@ require 'temporalio/internal/bridge/api/nexus/nexus'
|
|
|
16
16
|
require 'temporalio/internal/bridge/api/common/common'
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
descriptor_data = "\n;temporal/sdk/core/workflow_commands/workflow_commands.proto\x12\x19\x63oresdk.workflow_commands\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a$temporal/api/common/v1/message.proto\x1a$temporal/api/enums/v1/workflow.proto\x1a%temporal/api/failure/v1/message.proto\x1a\'temporal/api/sdk/v1/user_metadata.proto\x1a\x35temporal/sdk/core/child_workflow/child_workflow.proto\x1a#temporal/sdk/core/nexus/nexus.proto\x1a%temporal/sdk/core/common/common.proto\"\xe5\x0f\n\x0fWorkflowCommand\x12\x38\n\ruser_metadata\x18\x64 \x01(\x0b\x32!.temporal.api.sdk.v1.UserMetadata\x12<\n\x0bstart_timer\x18\x01 \x01(\x0b\x32%.coresdk.workflow_commands.StartTimerH\x00\x12H\n\x11schedule_activity\x18\x02 \x01(\x0b\x32+.coresdk.workflow_commands.ScheduleActivityH\x00\x12\x42\n\x10respond_to_query\x18\x03 \x01(\x0b\x32&.coresdk.workflow_commands.QueryResultH\x00\x12S\n\x17request_cancel_activity\x18\x04 \x01(\x0b\x32\x30.coresdk.workflow_commands.RequestCancelActivityH\x00\x12>\n\x0c\x63\x61ncel_timer\x18\x05 \x01(\x0b\x32&.coresdk.workflow_commands.CancelTimerH\x00\x12[\n\x1b\x63omplete_workflow_execution\x18\x06 \x01(\x0b\x32\x34.coresdk.workflow_commands.CompleteWorkflowExecutionH\x00\x12S\n\x17\x66\x61il_workflow_execution\x18\x07 \x01(\x0b\x32\x30.coresdk.workflow_commands.FailWorkflowExecutionH\x00\x12g\n\"continue_as_new_workflow_execution\x18\x08 \x01(\x0b\x32\x39.coresdk.workflow_commands.ContinueAsNewWorkflowExecutionH\x00\x12W\n\x19\x63\x61ncel_workflow_execution\x18\t \x01(\x0b\x32\x32.coresdk.workflow_commands.CancelWorkflowExecutionH\x00\x12\x45\n\x10set_patch_marker\x18\n \x01(\x0b\x32).coresdk.workflow_commands.SetPatchMarkerH\x00\x12`\n\x1estart_child_workflow_execution\x18\x0b \x01(\x0b\x32\x36.coresdk.workflow_commands.StartChildWorkflowExecutionH\x00\x12\x62\n\x1f\x63\x61ncel_child_workflow_execution\x18\x0c \x01(\x0b\x32\x37.coresdk.workflow_commands.CancelChildWorkflowExecutionH\x00\x12w\n*request_cancel_external_workflow_execution\x18\r \x01(\x0b\x32\x41.coresdk.workflow_commands.RequestCancelExternalWorkflowExecutionH\x00\x12h\n\"signal_external_workflow_execution\x18\x0e \x01(\x0b\x32:.coresdk.workflow_commands.SignalExternalWorkflowExecutionH\x00\x12Q\n\x16\x63\x61ncel_signal_workflow\x18\x0f \x01(\x0b\x32/.coresdk.workflow_commands.CancelSignalWorkflowH\x00\x12S\n\x17schedule_local_activity\x18\x10 \x01(\x0b\x32\x30.coresdk.workflow_commands.ScheduleLocalActivityH\x00\x12^\n\x1drequest_cancel_local_activity\x18\x11 \x01(\x0b\x32\x35.coresdk.workflow_commands.RequestCancelLocalActivityH\x00\x12\x66\n!upsert_workflow_search_attributes\x18\x12 \x01(\x0b\x32\x39.coresdk.workflow_commands.UpsertWorkflowSearchAttributesH\x00\x12Y\n\x1amodify_workflow_properties\x18\x13 \x01(\x0b\x32\x33.coresdk.workflow_commands.ModifyWorkflowPropertiesH\x00\x12\x44\n\x0fupdate_response\x18\x14 \x01(\x0b\x32).coresdk.workflow_commands.UpdateResponseH\x00\x12U\n\x18schedule_nexus_operation\x18\x15 \x01(\x0b\x32\x31.coresdk.workflow_commands.ScheduleNexusOperationH\x00\x12`\n\x1erequest_cancel_nexus_operation\x18\x16 \x01(\x0b\x32\x36.coresdk.workflow_commands.RequestCancelNexusOperationH\x00\x42\t\n\x07variant\"S\n\nStartTimer\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12\x38\n\x15start_to_fire_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"\x1a\n\x0b\x43\x61ncelTimer\x12\x0b\n\x03seq\x18\x01 \x01(\r\"\xb8\x06\n\x10ScheduleActivity\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12\x13\n\x0b\x61\x63tivity_id\x18\x02 \x01(\t\x12\x15\n\ractivity_type\x18\x03 \x01(\t\x12\x12\n\ntask_queue\x18\x05 \x01(\t\x12I\n\x07headers\x18\x06 \x03(\x0b\x32\x38.coresdk.workflow_commands.ScheduleActivity.HeadersEntry\x12\x32\n\targuments\x18\x07 \x03(\x0b\x32\x1f.temporal.api.common.v1.Payload\x12<\n\x19schedule_to_close_timeout\x18\x08 \x01(\x0b\x32\x19.google.protobuf.Duration\x12<\n\x19schedule_to_start_timeout\x18\t \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x39\n\x16start_to_close_timeout\x18\n \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x34\n\x11heartbeat_timeout\x18\x0b \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x39\n\x0cretry_policy\x18\x0c \x01(\x0b\x32#.temporal.api.common.v1.RetryPolicy\x12N\n\x11\x63\x61ncellation_type\x18\r \x01(\x0e\x32\x33.coresdk.workflow_commands.ActivityCancellationType\x12\x1e\n\x16\x64o_not_eagerly_execute\x18\x0e \x01(\x08\x12;\n\x11versioning_intent\x18\x0f \x01(\x0e\x32 .coresdk.common.VersioningIntent\x12\x32\n\x08priority\x18\x10 \x01(\x0b\x32 .temporal.api.common.v1.Priority\x1aO\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\"\xee\x05\n\x15ScheduleLocalActivity\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12\x13\n\x0b\x61\x63tivity_id\x18\x02 \x01(\t\x12\x15\n\ractivity_type\x18\x03 \x01(\t\x12\x0f\n\x07\x61ttempt\x18\x04 \x01(\r\x12:\n\x16original_schedule_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12N\n\x07headers\x18\x06 \x03(\x0b\x32=.coresdk.workflow_commands.ScheduleLocalActivity.HeadersEntry\x12\x32\n\targuments\x18\x07 \x03(\x0b\x32\x1f.temporal.api.common.v1.Payload\x12<\n\x19schedule_to_close_timeout\x18\x08 \x01(\x0b\x32\x19.google.protobuf.Duration\x12<\n\x19schedule_to_start_timeout\x18\t \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x39\n\x16start_to_close_timeout\x18\n \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x39\n\x0cretry_policy\x18\x0b \x01(\x0b\x32#.temporal.api.common.v1.RetryPolicy\x12\x38\n\x15local_retry_threshold\x18\x0c \x01(\x0b\x32\x19.google.protobuf.Duration\x12N\n\x11\x63\x61ncellation_type\x18\r \x01(\x0e\x32\x33.coresdk.workflow_commands.ActivityCancellationType\x1aO\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\"$\n\x15RequestCancelActivity\x12\x0b\n\x03seq\x18\x01 \x01(\r\")\n\x1aRequestCancelLocalActivity\x12\x0b\n\x03seq\x18\x01 \x01(\r\"\x9c\x01\n\x0bQueryResult\x12\x10\n\x08query_id\x18\x01 \x01(\t\x12<\n\tsucceeded\x18\x02 \x01(\x0b\x32\'.coresdk.workflow_commands.QuerySuccessH\x00\x12\x32\n\x06\x66\x61iled\x18\x03 \x01(\x0b\x32 .temporal.api.failure.v1.FailureH\x00\x42\t\n\x07variant\"A\n\x0cQuerySuccess\x12\x31\n\x08response\x18\x01 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload\"L\n\x19\x43ompleteWorkflowExecution\x12/\n\x06result\x18\x01 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload\"J\n\x15\x46\x61ilWorkflowExecution\x12\x31\n\x07\x66\x61ilure\x18\x01 \x01(\x0b\x32 .temporal.api.failure.v1.Failure\"\xfb\x06\n\x1e\x43ontinueAsNewWorkflowExecution\x12\x15\n\rworkflow_type\x18\x01 \x01(\t\x12\x12\n\ntask_queue\x18\x02 \x01(\t\x12\x32\n\targuments\x18\x03 \x03(\x0b\x32\x1f.temporal.api.common.v1.Payload\x12\x37\n\x14workflow_run_timeout\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x38\n\x15workflow_task_timeout\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12Q\n\x04memo\x18\x06 \x03(\x0b\x32\x43.coresdk.workflow_commands.ContinueAsNewWorkflowExecution.MemoEntry\x12W\n\x07headers\x18\x07 \x03(\x0b\x32\x46.coresdk.workflow_commands.ContinueAsNewWorkflowExecution.HeadersEntry\x12j\n\x11search_attributes\x18\x08 \x03(\x0b\x32O.coresdk.workflow_commands.ContinueAsNewWorkflowExecution.SearchAttributesEntry\x12\x39\n\x0cretry_policy\x18\t \x01(\x0b\x32#.temporal.api.common.v1.RetryPolicy\x12;\n\x11versioning_intent\x18\n \x01(\x0e\x32 .coresdk.common.VersioningIntent\x1aL\n\tMemoEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\x1aO\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\x1aX\n\x15SearchAttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\"\x19\n\x17\x43\x61ncelWorkflowExecution\"6\n\x0eSetPatchMarker\x12\x10\n\x08patch_id\x18\x01 \x01(\t\x12\x12\n\ndeprecated\x18\x02 \x01(\x08\"\x94\n\n\x1bStartChildWorkflowExecution\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12\x11\n\tnamespace\x18\x02 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x03 \x01(\t\x12\x15\n\rworkflow_type\x18\x04 \x01(\t\x12\x12\n\ntask_queue\x18\x05 \x01(\t\x12.\n\x05input\x18\x06 \x03(\x0b\x32\x1f.temporal.api.common.v1.Payload\x12=\n\x1aworkflow_execution_timeout\x18\x07 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\x14workflow_run_timeout\x18\x08 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x38\n\x15workflow_task_timeout\x18\t \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x46\n\x13parent_close_policy\x18\n \x01(\x0e\x32).coresdk.child_workflow.ParentClosePolicy\x12N\n\x18workflow_id_reuse_policy\x18\x0c \x01(\x0e\x32,.temporal.api.enums.v1.WorkflowIdReusePolicy\x12\x39\n\x0cretry_policy\x18\r \x01(\x0b\x32#.temporal.api.common.v1.RetryPolicy\x12\x15\n\rcron_schedule\x18\x0e \x01(\t\x12T\n\x07headers\x18\x0f \x03(\x0b\x32\x43.coresdk.workflow_commands.StartChildWorkflowExecution.HeadersEntry\x12N\n\x04memo\x18\x10 \x03(\x0b\x32@.coresdk.workflow_commands.StartChildWorkflowExecution.MemoEntry\x12g\n\x11search_attributes\x18\x11 \x03(\x0b\x32L.coresdk.workflow_commands.StartChildWorkflowExecution.SearchAttributesEntry\x12P\n\x11\x63\x61ncellation_type\x18\x12 \x01(\x0e\x32\x35.coresdk.child_workflow.ChildWorkflowCancellationType\x12;\n\x11versioning_intent\x18\x13 \x01(\x0e\x32 .coresdk.common.VersioningIntent\x12\x32\n\x08priority\x18\x14 \x01(\x0b\x32 .temporal.api.common.v1.Priority\x1aO\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\x1aL\n\tMemoEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\x1aX\n\x15SearchAttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\"J\n\x1c\x43\x61ncelChildWorkflowExecution\x12\x1a\n\x12\x63hild_workflow_seq\x18\x01 \x01(\r\x12\x0e\n\x06reason\x18\x02 \x01(\t\"\x8e\x01\n&RequestCancelExternalWorkflowExecution\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12G\n\x12workflow_execution\x18\x02 \x01(\x0b\x32+.coresdk.common.NamespacedWorkflowExecution\x12\x0e\n\x06reason\x18\x03 \x01(\t\"\x8f\x03\n\x1fSignalExternalWorkflowExecution\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12I\n\x12workflow_execution\x18\x02 \x01(\x0b\x32+.coresdk.common.NamespacedWorkflowExecutionH\x00\x12\x1b\n\x11\x63hild_workflow_id\x18\x03 \x01(\tH\x00\x12\x13\n\x0bsignal_name\x18\x04 \x01(\t\x12-\n\x04\x61rgs\x18\x05 \x03(\x0b\x32\x1f.temporal.api.common.v1.Payload\x12X\n\x07headers\x18\x06 \x03(\x0b\x32G.coresdk.workflow_commands.SignalExternalWorkflowExecution.HeadersEntry\x1aO\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\x42\x08\n\x06target\"#\n\x14\x43\x61ncelSignalWorkflow\x12\x0b\n\x03seq\x18\x01 \x01(\r\"\xe6\x01\n\x1eUpsertWorkflowSearchAttributes\x12j\n\x11search_attributes\x18\x01 \x03(\x0b\x32O.coresdk.workflow_commands.UpsertWorkflowSearchAttributes.SearchAttributesEntry\x1aX\n\x15SearchAttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\"O\n\x18ModifyWorkflowProperties\x12\x33\n\rupserted_memo\x18\x01 \x01(\x0b\x32\x1c.temporal.api.common.v1.Memo\"\xd2\x01\n\x0eUpdateResponse\x12\x1c\n\x14protocol_instance_id\x18\x01 \x01(\t\x12*\n\x08\x61\x63\x63\x65pted\x18\x02 \x01(\x0b\x32\x16.google.protobuf.EmptyH\x00\x12\x34\n\x08rejected\x18\x03 \x01(\x0b\x32 .temporal.api.failure.v1.FailureH\x00\x12\x34\n\tcompleted\x18\x04 \x01(\x0b\x32\x1f.temporal.api.common.v1.PayloadH\x00\x42\n\n\x08response\"\xa1\x03\n\x16ScheduleNexusOperation\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12\x10\n\x08\x65ndpoint\x18\x02 \x01(\t\x12\x0f\n\x07service\x18\x03 \x01(\t\x12\x11\n\toperation\x18\x04 \x01(\t\x12.\n\x05input\x18\x05 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload\x12<\n\x19schedule_to_close_timeout\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12X\n\x0cnexus_header\x18\x07 \x03(\x0b\x32\x42.coresdk.workflow_commands.ScheduleNexusOperation.NexusHeaderEntry\x12H\n\x11\x63\x61ncellation_type\x18\x08 \x01(\x0e\x32-.coresdk.nexus.NexusOperationCancellationType\x1a\x32\n\x10NexusHeaderEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"*\n\x1bRequestCancelNexusOperation\x12\x0b\n\x03seq\x18\x01 \x01(\r*X\n\x18\x41\x63tivityCancellationType\x12\x0e\n\nTRY_CANCEL\x10\x00\x12\x1f\n\x1bWAIT_CANCELLATION_COMPLETED\x10\x01\x12\x0b\n\x07\x41\x42\x41NDON\x10\x02\x42\x36\xea\x02\x33Temporalio::Internal::Bridge::Api::WorkflowCommandsb\x06proto3"
|
|
19
|
+
descriptor_data = "\n;temporal/sdk/core/workflow_commands/workflow_commands.proto\x12\x19\x63oresdk.workflow_commands\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a$temporal/api/common/v1/message.proto\x1a$temporal/api/enums/v1/workflow.proto\x1a%temporal/api/failure/v1/message.proto\x1a\'temporal/api/sdk/v1/user_metadata.proto\x1a\x35temporal/sdk/core/child_workflow/child_workflow.proto\x1a#temporal/sdk/core/nexus/nexus.proto\x1a%temporal/sdk/core/common/common.proto\"\xe5\x0f\n\x0fWorkflowCommand\x12\x38\n\ruser_metadata\x18\x64 \x01(\x0b\x32!.temporal.api.sdk.v1.UserMetadata\x12<\n\x0bstart_timer\x18\x01 \x01(\x0b\x32%.coresdk.workflow_commands.StartTimerH\x00\x12H\n\x11schedule_activity\x18\x02 \x01(\x0b\x32+.coresdk.workflow_commands.ScheduleActivityH\x00\x12\x42\n\x10respond_to_query\x18\x03 \x01(\x0b\x32&.coresdk.workflow_commands.QueryResultH\x00\x12S\n\x17request_cancel_activity\x18\x04 \x01(\x0b\x32\x30.coresdk.workflow_commands.RequestCancelActivityH\x00\x12>\n\x0c\x63\x61ncel_timer\x18\x05 \x01(\x0b\x32&.coresdk.workflow_commands.CancelTimerH\x00\x12[\n\x1b\x63omplete_workflow_execution\x18\x06 \x01(\x0b\x32\x34.coresdk.workflow_commands.CompleteWorkflowExecutionH\x00\x12S\n\x17\x66\x61il_workflow_execution\x18\x07 \x01(\x0b\x32\x30.coresdk.workflow_commands.FailWorkflowExecutionH\x00\x12g\n\"continue_as_new_workflow_execution\x18\x08 \x01(\x0b\x32\x39.coresdk.workflow_commands.ContinueAsNewWorkflowExecutionH\x00\x12W\n\x19\x63\x61ncel_workflow_execution\x18\t \x01(\x0b\x32\x32.coresdk.workflow_commands.CancelWorkflowExecutionH\x00\x12\x45\n\x10set_patch_marker\x18\n \x01(\x0b\x32).coresdk.workflow_commands.SetPatchMarkerH\x00\x12`\n\x1estart_child_workflow_execution\x18\x0b \x01(\x0b\x32\x36.coresdk.workflow_commands.StartChildWorkflowExecutionH\x00\x12\x62\n\x1f\x63\x61ncel_child_workflow_execution\x18\x0c \x01(\x0b\x32\x37.coresdk.workflow_commands.CancelChildWorkflowExecutionH\x00\x12w\n*request_cancel_external_workflow_execution\x18\r \x01(\x0b\x32\x41.coresdk.workflow_commands.RequestCancelExternalWorkflowExecutionH\x00\x12h\n\"signal_external_workflow_execution\x18\x0e \x01(\x0b\x32:.coresdk.workflow_commands.SignalExternalWorkflowExecutionH\x00\x12Q\n\x16\x63\x61ncel_signal_workflow\x18\x0f \x01(\x0b\x32/.coresdk.workflow_commands.CancelSignalWorkflowH\x00\x12S\n\x17schedule_local_activity\x18\x10 \x01(\x0b\x32\x30.coresdk.workflow_commands.ScheduleLocalActivityH\x00\x12^\n\x1drequest_cancel_local_activity\x18\x11 \x01(\x0b\x32\x35.coresdk.workflow_commands.RequestCancelLocalActivityH\x00\x12\x66\n!upsert_workflow_search_attributes\x18\x12 \x01(\x0b\x32\x39.coresdk.workflow_commands.UpsertWorkflowSearchAttributesH\x00\x12Y\n\x1amodify_workflow_properties\x18\x13 \x01(\x0b\x32\x33.coresdk.workflow_commands.ModifyWorkflowPropertiesH\x00\x12\x44\n\x0fupdate_response\x18\x14 \x01(\x0b\x32).coresdk.workflow_commands.UpdateResponseH\x00\x12U\n\x18schedule_nexus_operation\x18\x15 \x01(\x0b\x32\x31.coresdk.workflow_commands.ScheduleNexusOperationH\x00\x12`\n\x1erequest_cancel_nexus_operation\x18\x16 \x01(\x0b\x32\x36.coresdk.workflow_commands.RequestCancelNexusOperationH\x00\x42\t\n\x07variant\"S\n\nStartTimer\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12\x38\n\x15start_to_fire_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"\x1a\n\x0b\x43\x61ncelTimer\x12\x0b\n\x03seq\x18\x01 \x01(\r\"\xb8\x06\n\x10ScheduleActivity\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12\x13\n\x0b\x61\x63tivity_id\x18\x02 \x01(\t\x12\x15\n\ractivity_type\x18\x03 \x01(\t\x12\x12\n\ntask_queue\x18\x05 \x01(\t\x12I\n\x07headers\x18\x06 \x03(\x0b\x32\x38.coresdk.workflow_commands.ScheduleActivity.HeadersEntry\x12\x32\n\targuments\x18\x07 \x03(\x0b\x32\x1f.temporal.api.common.v1.Payload\x12<\n\x19schedule_to_close_timeout\x18\x08 \x01(\x0b\x32\x19.google.protobuf.Duration\x12<\n\x19schedule_to_start_timeout\x18\t \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x39\n\x16start_to_close_timeout\x18\n \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x34\n\x11heartbeat_timeout\x18\x0b \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x39\n\x0cretry_policy\x18\x0c \x01(\x0b\x32#.temporal.api.common.v1.RetryPolicy\x12N\n\x11\x63\x61ncellation_type\x18\r \x01(\x0e\x32\x33.coresdk.workflow_commands.ActivityCancellationType\x12\x1e\n\x16\x64o_not_eagerly_execute\x18\x0e \x01(\x08\x12;\n\x11versioning_intent\x18\x0f \x01(\x0e\x32 .coresdk.common.VersioningIntent\x12\x32\n\x08priority\x18\x10 \x01(\x0b\x32 .temporal.api.common.v1.Priority\x1aO\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\"\xee\x05\n\x15ScheduleLocalActivity\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12\x13\n\x0b\x61\x63tivity_id\x18\x02 \x01(\t\x12\x15\n\ractivity_type\x18\x03 \x01(\t\x12\x0f\n\x07\x61ttempt\x18\x04 \x01(\r\x12:\n\x16original_schedule_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12N\n\x07headers\x18\x06 \x03(\x0b\x32=.coresdk.workflow_commands.ScheduleLocalActivity.HeadersEntry\x12\x32\n\targuments\x18\x07 \x03(\x0b\x32\x1f.temporal.api.common.v1.Payload\x12<\n\x19schedule_to_close_timeout\x18\x08 \x01(\x0b\x32\x19.google.protobuf.Duration\x12<\n\x19schedule_to_start_timeout\x18\t \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x39\n\x16start_to_close_timeout\x18\n \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x39\n\x0cretry_policy\x18\x0b \x01(\x0b\x32#.temporal.api.common.v1.RetryPolicy\x12\x38\n\x15local_retry_threshold\x18\x0c \x01(\x0b\x32\x19.google.protobuf.Duration\x12N\n\x11\x63\x61ncellation_type\x18\r \x01(\x0e\x32\x33.coresdk.workflow_commands.ActivityCancellationType\x1aO\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\"$\n\x15RequestCancelActivity\x12\x0b\n\x03seq\x18\x01 \x01(\r\")\n\x1aRequestCancelLocalActivity\x12\x0b\n\x03seq\x18\x01 \x01(\r\"\x9c\x01\n\x0bQueryResult\x12\x10\n\x08query_id\x18\x01 \x01(\t\x12<\n\tsucceeded\x18\x02 \x01(\x0b\x32\'.coresdk.workflow_commands.QuerySuccessH\x00\x12\x32\n\x06\x66\x61iled\x18\x03 \x01(\x0b\x32 .temporal.api.failure.v1.FailureH\x00\x42\t\n\x07variant\"A\n\x0cQuerySuccess\x12\x31\n\x08response\x18\x01 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload\"L\n\x19\x43ompleteWorkflowExecution\x12/\n\x06result\x18\x01 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload\"J\n\x15\x46\x61ilWorkflowExecution\x12\x31\n\x07\x66\x61ilure\x18\x01 \x01(\x0b\x32 .temporal.api.failure.v1.Failure\"\xfb\x06\n\x1e\x43ontinueAsNewWorkflowExecution\x12\x15\n\rworkflow_type\x18\x01 \x01(\t\x12\x12\n\ntask_queue\x18\x02 \x01(\t\x12\x32\n\targuments\x18\x03 \x03(\x0b\x32\x1f.temporal.api.common.v1.Payload\x12\x37\n\x14workflow_run_timeout\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x38\n\x15workflow_task_timeout\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12Q\n\x04memo\x18\x06 \x03(\x0b\x32\x43.coresdk.workflow_commands.ContinueAsNewWorkflowExecution.MemoEntry\x12W\n\x07headers\x18\x07 \x03(\x0b\x32\x46.coresdk.workflow_commands.ContinueAsNewWorkflowExecution.HeadersEntry\x12j\n\x11search_attributes\x18\x08 \x03(\x0b\x32O.coresdk.workflow_commands.ContinueAsNewWorkflowExecution.SearchAttributesEntry\x12\x39\n\x0cretry_policy\x18\t \x01(\x0b\x32#.temporal.api.common.v1.RetryPolicy\x12;\n\x11versioning_intent\x18\n \x01(\x0e\x32 .coresdk.common.VersioningIntent\x1aL\n\tMemoEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\x1aO\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\x1aX\n\x15SearchAttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\"\x19\n\x17\x43\x61ncelWorkflowExecution\"6\n\x0eSetPatchMarker\x12\x10\n\x08patch_id\x18\x01 \x01(\t\x12\x12\n\ndeprecated\x18\x02 \x01(\x08\"\x94\n\n\x1bStartChildWorkflowExecution\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12\x11\n\tnamespace\x18\x02 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x03 \x01(\t\x12\x15\n\rworkflow_type\x18\x04 \x01(\t\x12\x12\n\ntask_queue\x18\x05 \x01(\t\x12.\n\x05input\x18\x06 \x03(\x0b\x32\x1f.temporal.api.common.v1.Payload\x12=\n\x1aworkflow_execution_timeout\x18\x07 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\x14workflow_run_timeout\x18\x08 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x38\n\x15workflow_task_timeout\x18\t \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x46\n\x13parent_close_policy\x18\n \x01(\x0e\x32).coresdk.child_workflow.ParentClosePolicy\x12N\n\x18workflow_id_reuse_policy\x18\x0c \x01(\x0e\x32,.temporal.api.enums.v1.WorkflowIdReusePolicy\x12\x39\n\x0cretry_policy\x18\r \x01(\x0b\x32#.temporal.api.common.v1.RetryPolicy\x12\x15\n\rcron_schedule\x18\x0e \x01(\t\x12T\n\x07headers\x18\x0f \x03(\x0b\x32\x43.coresdk.workflow_commands.StartChildWorkflowExecution.HeadersEntry\x12N\n\x04memo\x18\x10 \x03(\x0b\x32@.coresdk.workflow_commands.StartChildWorkflowExecution.MemoEntry\x12g\n\x11search_attributes\x18\x11 \x03(\x0b\x32L.coresdk.workflow_commands.StartChildWorkflowExecution.SearchAttributesEntry\x12P\n\x11\x63\x61ncellation_type\x18\x12 \x01(\x0e\x32\x35.coresdk.child_workflow.ChildWorkflowCancellationType\x12;\n\x11versioning_intent\x18\x13 \x01(\x0e\x32 .coresdk.common.VersioningIntent\x12\x32\n\x08priority\x18\x14 \x01(\x0b\x32 .temporal.api.common.v1.Priority\x1aO\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\x1aL\n\tMemoEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\x1aX\n\x15SearchAttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\"J\n\x1c\x43\x61ncelChildWorkflowExecution\x12\x1a\n\x12\x63hild_workflow_seq\x18\x01 \x01(\r\x12\x0e\n\x06reason\x18\x02 \x01(\t\"\x8e\x01\n&RequestCancelExternalWorkflowExecution\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12G\n\x12workflow_execution\x18\x02 \x01(\x0b\x32+.coresdk.common.NamespacedWorkflowExecution\x12\x0e\n\x06reason\x18\x03 \x01(\t\"\x8f\x03\n\x1fSignalExternalWorkflowExecution\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12I\n\x12workflow_execution\x18\x02 \x01(\x0b\x32+.coresdk.common.NamespacedWorkflowExecutionH\x00\x12\x1b\n\x11\x63hild_workflow_id\x18\x03 \x01(\tH\x00\x12\x13\n\x0bsignal_name\x18\x04 \x01(\t\x12-\n\x04\x61rgs\x18\x05 \x03(\x0b\x32\x1f.temporal.api.common.v1.Payload\x12X\n\x07headers\x18\x06 \x03(\x0b\x32G.coresdk.workflow_commands.SignalExternalWorkflowExecution.HeadersEntry\x1aO\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\x42\x08\n\x06target\"#\n\x14\x43\x61ncelSignalWorkflow\x12\x0b\n\x03seq\x18\x01 \x01(\r\"\xe6\x01\n\x1eUpsertWorkflowSearchAttributes\x12j\n\x11search_attributes\x18\x01 \x03(\x0b\x32O.coresdk.workflow_commands.UpsertWorkflowSearchAttributes.SearchAttributesEntry\x1aX\n\x15SearchAttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\"O\n\x18ModifyWorkflowProperties\x12\x33\n\rupserted_memo\x18\x01 \x01(\x0b\x32\x1c.temporal.api.common.v1.Memo\"\xd2\x01\n\x0eUpdateResponse\x12\x1c\n\x14protocol_instance_id\x18\x01 \x01(\t\x12*\n\x08\x61\x63\x63\x65pted\x18\x02 \x01(\x0b\x32\x16.google.protobuf.EmptyH\x00\x12\x34\n\x08rejected\x18\x03 \x01(\x0b\x32 .temporal.api.failure.v1.FailureH\x00\x12\x34\n\tcompleted\x18\x04 \x01(\x0b\x32\x1f.temporal.api.common.v1.PayloadH\x00\x42\n\n\x08response\"\x9a\x04\n\x16ScheduleNexusOperation\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12\x10\n\x08\x65ndpoint\x18\x02 \x01(\t\x12\x0f\n\x07service\x18\x03 \x01(\t\x12\x11\n\toperation\x18\x04 \x01(\t\x12.\n\x05input\x18\x05 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload\x12<\n\x19schedule_to_close_timeout\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12X\n\x0cnexus_header\x18\x07 \x03(\x0b\x32\x42.coresdk.workflow_commands.ScheduleNexusOperation.NexusHeaderEntry\x12H\n\x11\x63\x61ncellation_type\x18\x08 \x01(\x0e\x32-.coresdk.nexus.NexusOperationCancellationType\x12<\n\x19schedule_to_start_timeout\x18\t \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x39\n\x16start_to_close_timeout\x18\n \x01(\x0b\x32\x19.google.protobuf.Duration\x1a\x32\n\x10NexusHeaderEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"*\n\x1bRequestCancelNexusOperation\x12\x0b\n\x03seq\x18\x01 \x01(\r*X\n\x18\x41\x63tivityCancellationType\x12\x0e\n\nTRY_CANCEL\x10\x00\x12\x1f\n\x1bWAIT_CANCELLATION_COMPLETED\x10\x01\x12\x0b\n\x07\x41\x42\x41NDON\x10\x02\x42\x36\xea\x02\x33Temporalio::Internal::Bridge::Api::WorkflowCommandsb\x06proto3"
|
|
20
20
|
|
|
21
21
|
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
|
22
22
|
pool.add_serialized_file(descriptor_data)
|
|
@@ -6,6 +6,7 @@ require 'temporalio/internal/bridge/api'
|
|
|
6
6
|
require 'temporalio/internal/proto_utils'
|
|
7
7
|
require 'temporalio/internal/worker/workflow_instance'
|
|
8
8
|
require 'temporalio/internal/worker/workflow_instance/external_workflow_handle'
|
|
9
|
+
require 'temporalio/internal/worker/workflow_instance/nexus_client'
|
|
9
10
|
require 'temporalio/worker/interceptor'
|
|
10
11
|
require 'temporalio/workflow'
|
|
11
12
|
|
|
@@ -32,6 +33,10 @@ module Temporalio
|
|
|
32
33
|
@instance.continue_as_new_suggested
|
|
33
34
|
end
|
|
34
35
|
|
|
36
|
+
def create_nexus_client(endpoint:, service:)
|
|
37
|
+
NexusClient.new(endpoint:, service:, outbound: @outbound)
|
|
38
|
+
end
|
|
39
|
+
|
|
35
40
|
def current_details
|
|
36
41
|
@instance.current_details || ''
|
|
37
42
|
end
|
|
@@ -242,6 +247,10 @@ module Temporalio
|
|
|
242
247
|
@instance.replaying
|
|
243
248
|
end
|
|
244
249
|
|
|
250
|
+
def replaying_history_events?
|
|
251
|
+
@instance.replaying && !@instance.in_query_or_validator
|
|
252
|
+
end
|
|
253
|
+
|
|
245
254
|
def search_attributes
|
|
246
255
|
@instance.search_attributes
|
|
247
256
|
end
|
|
@@ -9,7 +9,7 @@ module Temporalio
|
|
|
9
9
|
# Delegator to a hash that does not allow external mutations. Used for memo.
|
|
10
10
|
class ExternallyImmutableHash < SimpleDelegator
|
|
11
11
|
def initialize(initial_hash)
|
|
12
|
-
super(initial_hash.freeze)
|
|
12
|
+
super(initial_hash.freeze) # steep:ignore ArgumentTypeMismatch
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def _update(&)
|
|
@@ -7,7 +7,7 @@ module Temporalio
|
|
|
7
7
|
# Hash for handlers that notifies when one is added. Only `[]=` and `store` can be used to mutate it.
|
|
8
8
|
class HandlerHash < SimpleDelegator
|
|
9
9
|
def initialize(initial_frozen_hash, definition_class, &on_new_definition)
|
|
10
|
-
super(initial_frozen_hash)
|
|
10
|
+
super(initial_frozen_hash) # steep:ignore ArgumentTypeMismatch
|
|
11
11
|
@definition_class = definition_class
|
|
12
12
|
@on_new_definition = on_new_definition
|
|
13
13
|
end
|
|
@@ -13,7 +13,7 @@ module Temporalio
|
|
|
13
13
|
illegal_calls.to_h do |key, val|
|
|
14
14
|
raise TypeError, 'Invalid illegal call map, top-level key must be a String' unless key.is_a?(String)
|
|
15
15
|
|
|
16
|
-
# @type var fixed_val: :all | Worker::IllegalWorkflowCallValidator | Hash[Symbol,
|
|
16
|
+
# @type var fixed_val: :all | Temporalio::Worker::IllegalWorkflowCallValidator | Hash[Symbol, (true | Temporalio::Worker::IllegalWorkflowCallValidator)]
|
|
17
17
|
fixed_val = case val
|
|
18
18
|
when Temporalio::Worker::IllegalWorkflowCallValidator
|
|
19
19
|
if val.method_name
|
|
@@ -86,21 +86,25 @@ module Temporalio
|
|
|
86
86
|
when Temporalio::Worker::IllegalWorkflowCallValidator
|
|
87
87
|
disable_temporarily do
|
|
88
88
|
vals.block.call(Temporalio::Worker::IllegalWorkflowCallValidator::CallInfo.new(
|
|
89
|
-
class_name:,
|
|
89
|
+
class_name:,
|
|
90
|
+
method_name: tp.callee_id || :__unknown__,
|
|
91
|
+
trace_point: tp
|
|
90
92
|
))
|
|
91
93
|
nil
|
|
92
94
|
rescue Exception => e # rubocop:disable Lint/RescueException
|
|
93
95
|
", reason: #{e}"
|
|
94
96
|
end
|
|
95
97
|
else
|
|
96
|
-
per_method = vals&.[](tp.callee_id)
|
|
98
|
+
per_method = vals&.[](tp.callee_id || :__unknown__)
|
|
97
99
|
case per_method
|
|
98
100
|
when true
|
|
99
101
|
''
|
|
100
102
|
when Temporalio::Worker::IllegalWorkflowCallValidator
|
|
101
103
|
disable_temporarily do
|
|
102
104
|
per_method.block.call(Temporalio::Worker::IllegalWorkflowCallValidator::CallInfo.new(
|
|
103
|
-
class_name:,
|
|
105
|
+
class_name:,
|
|
106
|
+
method_name: tp.callee_id || :__unknown__,
|
|
107
|
+
trace_point: tp
|
|
104
108
|
))
|
|
105
109
|
nil
|
|
106
110
|
rescue Exception => e # rubocop:disable Lint/RescueException
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'temporalio/workflow'
|
|
4
|
+
require 'temporalio/workflow/nexus_client'
|
|
5
|
+
|
|
6
|
+
module Temporalio
|
|
7
|
+
module Internal
|
|
8
|
+
module Worker
|
|
9
|
+
class WorkflowInstance
|
|
10
|
+
# Implementation of the Nexus client.
|
|
11
|
+
class NexusClient < Workflow::NexusClient
|
|
12
|
+
attr_reader :endpoint, :service
|
|
13
|
+
|
|
14
|
+
def initialize(endpoint:, service:, outbound:) # rubocop:disable Lint/MissingSuper
|
|
15
|
+
@endpoint = endpoint.to_s
|
|
16
|
+
@service = service.to_s
|
|
17
|
+
@outbound = outbound
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def start_operation(operation, arg, schedule_to_close_timeout: nil, cancellation_type: nil, summary: nil,
|
|
21
|
+
cancellation: Workflow.cancellation, arg_hint: nil, result_hint: nil)
|
|
22
|
+
@outbound.start_nexus_operation(
|
|
23
|
+
Temporalio::Worker::Interceptor::Workflow::StartNexusOperationInput.new(
|
|
24
|
+
endpoint: @endpoint,
|
|
25
|
+
service: @service,
|
|
26
|
+
operation: operation.to_s,
|
|
27
|
+
arg:,
|
|
28
|
+
schedule_to_close_timeout:,
|
|
29
|
+
cancellation_type:,
|
|
30
|
+
summary:,
|
|
31
|
+
cancellation:,
|
|
32
|
+
arg_hint:,
|
|
33
|
+
result_hint:,
|
|
34
|
+
headers: {}
|
|
35
|
+
)
|
|
36
|
+
)
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'temporalio/cancellation'
|
|
4
|
+
require 'temporalio/workflow'
|
|
5
|
+
require 'temporalio/workflow/nexus_operation_handle'
|
|
6
|
+
|
|
7
|
+
module Temporalio
|
|
8
|
+
module Internal
|
|
9
|
+
module Worker
|
|
10
|
+
class WorkflowInstance
|
|
11
|
+
# Implementation of the Nexus operation handle.
|
|
12
|
+
class NexusOperationHandle < Workflow::NexusOperationHandle
|
|
13
|
+
attr_reader :operation_token, :result_hint
|
|
14
|
+
|
|
15
|
+
def initialize(operation_token:, instance:, cancellation:, cancel_callback_key:, # rubocop:disable Lint/MissingSuper
|
|
16
|
+
result_hint:)
|
|
17
|
+
@operation_token = operation_token
|
|
18
|
+
@instance = instance
|
|
19
|
+
@cancellation = cancellation
|
|
20
|
+
@cancel_callback_key = cancel_callback_key
|
|
21
|
+
@result_hint = result_hint
|
|
22
|
+
@resolution = nil
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def result(result_hint: nil)
|
|
26
|
+
# Use detached cancellation like child workflow to avoid interrupting result wait
|
|
27
|
+
Workflow.wait_condition(cancellation: Cancellation.new) { @resolution }
|
|
28
|
+
|
|
29
|
+
case @resolution.status
|
|
30
|
+
when :completed
|
|
31
|
+
@instance.payload_converter.from_payload(@resolution.completed, hint: result_hint || @result_hint)
|
|
32
|
+
when :failed
|
|
33
|
+
raise @instance.failure_converter.from_failure(@resolution.failed, @instance.payload_converter)
|
|
34
|
+
when :cancelled
|
|
35
|
+
raise @instance.failure_converter.from_failure(@resolution.cancelled, @instance.payload_converter)
|
|
36
|
+
when :timed_out
|
|
37
|
+
raise @instance.failure_converter.from_failure(@resolution.timed_out, @instance.payload_converter)
|
|
38
|
+
else
|
|
39
|
+
raise "Unrecognized Nexus operation result status: #{@resolution.status}"
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def _resolve(resolution)
|
|
44
|
+
@cancellation.remove_cancel_callback(@cancel_callback_key)
|
|
45
|
+
@resolution = resolution
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -6,6 +6,7 @@ require 'temporalio/error'
|
|
|
6
6
|
require 'temporalio/internal/bridge/api'
|
|
7
7
|
require 'temporalio/internal/proto_utils'
|
|
8
8
|
require 'temporalio/internal/worker/workflow_instance'
|
|
9
|
+
require 'temporalio/internal/worker/workflow_instance/nexus_operation_handle'
|
|
9
10
|
require 'temporalio/worker/interceptor'
|
|
10
11
|
require 'temporalio/workflow'
|
|
11
12
|
require 'temporalio/workflow/child_workflow_handle'
|
|
@@ -22,6 +23,7 @@ module Temporalio
|
|
|
22
23
|
@activity_counter = 0
|
|
23
24
|
@timer_counter = 0
|
|
24
25
|
@child_counter = 0
|
|
26
|
+
@nexus_operation_counter = 0
|
|
25
27
|
@external_signal_counter = 0
|
|
26
28
|
@external_cancel_counter = 0
|
|
27
29
|
end
|
|
@@ -43,7 +45,12 @@ module Temporalio
|
|
|
43
45
|
@instance.pending_external_cancels[seq] = Fiber.current
|
|
44
46
|
|
|
45
47
|
# Wait
|
|
46
|
-
resolution =
|
|
48
|
+
resolution = begin
|
|
49
|
+
Fiber.yield
|
|
50
|
+
ensure
|
|
51
|
+
# Remove pending
|
|
52
|
+
@instance.pending_external_cancels.delete(seq)
|
|
53
|
+
end
|
|
47
54
|
|
|
48
55
|
# Raise if resolution has failure
|
|
49
56
|
return unless resolution.failure
|
|
@@ -169,10 +176,13 @@ module Temporalio
|
|
|
169
176
|
end
|
|
170
177
|
|
|
171
178
|
# Wait
|
|
172
|
-
resolution =
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
179
|
+
resolution = begin
|
|
180
|
+
Fiber.yield
|
|
181
|
+
ensure
|
|
182
|
+
# Remove pending and cancel callback
|
|
183
|
+
@instance.pending_activities.delete(seq)
|
|
184
|
+
cancellation.remove_cancel_callback(cancel_callback_key)
|
|
185
|
+
end
|
|
176
186
|
|
|
177
187
|
case resolution.status
|
|
178
188
|
when :completed
|
|
@@ -254,10 +264,13 @@ module Temporalio
|
|
|
254
264
|
end
|
|
255
265
|
|
|
256
266
|
# Wait
|
|
257
|
-
resolution =
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
267
|
+
resolution = begin
|
|
268
|
+
Fiber.yield
|
|
269
|
+
ensure
|
|
270
|
+
# Remove pending and cancel callback
|
|
271
|
+
@instance.pending_external_signals.delete(seq)
|
|
272
|
+
cancellation.remove_cancel_callback(cancel_callback_key)
|
|
273
|
+
end
|
|
261
274
|
|
|
262
275
|
# Raise if resolution has failure
|
|
263
276
|
return unless resolution.failure
|
|
@@ -317,7 +330,12 @@ module Temporalio
|
|
|
317
330
|
end
|
|
318
331
|
|
|
319
332
|
# Wait
|
|
320
|
-
|
|
333
|
+
begin
|
|
334
|
+
Fiber.yield
|
|
335
|
+
ensure
|
|
336
|
+
# Remove pending
|
|
337
|
+
@instance.pending_timers.delete(seq)
|
|
338
|
+
end
|
|
321
339
|
|
|
322
340
|
# Remove cancellation callback (only needed on success)
|
|
323
341
|
input.cancellation.remove_cancel_callback(cancel_callback_key)
|
|
@@ -374,7 +392,12 @@ module Temporalio
|
|
|
374
392
|
end
|
|
375
393
|
|
|
376
394
|
# Wait for start
|
|
377
|
-
resolution =
|
|
395
|
+
resolution = begin
|
|
396
|
+
Fiber.yield
|
|
397
|
+
ensure
|
|
398
|
+
# Remove pending
|
|
399
|
+
@instance.pending_child_workflow_starts.delete(seq)
|
|
400
|
+
end
|
|
378
401
|
|
|
379
402
|
case resolution.status
|
|
380
403
|
when :succeeded
|
|
@@ -408,6 +431,72 @@ module Temporalio
|
|
|
408
431
|
raise "Unknown resolution status: #{resolution.status}"
|
|
409
432
|
end
|
|
410
433
|
end
|
|
434
|
+
|
|
435
|
+
def start_nexus_operation(input)
|
|
436
|
+
raise Error::CanceledError, 'Nexus operation canceled before scheduled' if input.cancellation.canceled?
|
|
437
|
+
|
|
438
|
+
# Add the command
|
|
439
|
+
seq = (@nexus_operation_counter += 1)
|
|
440
|
+
@instance.add_command(
|
|
441
|
+
Bridge::Api::WorkflowCommands::WorkflowCommand.new(
|
|
442
|
+
schedule_nexus_operation: Bridge::Api::WorkflowCommands::ScheduleNexusOperation.new(
|
|
443
|
+
seq:,
|
|
444
|
+
endpoint: input.endpoint,
|
|
445
|
+
service: input.service,
|
|
446
|
+
operation: input.operation,
|
|
447
|
+
input: @instance.payload_converter.to_payload(input.arg, hint: input.arg_hint),
|
|
448
|
+
schedule_to_close_timeout: ProtoUtils.seconds_to_duration(input.schedule_to_close_timeout),
|
|
449
|
+
nexus_header: input.headers,
|
|
450
|
+
cancellation_type: input.cancellation_type
|
|
451
|
+
),
|
|
452
|
+
user_metadata: ProtoUtils.to_user_metadata(input.summary, nil, @instance.payload_converter)
|
|
453
|
+
)
|
|
454
|
+
)
|
|
455
|
+
|
|
456
|
+
# Set as pending start
|
|
457
|
+
@instance.pending_nexus_operation_starts[seq] = Fiber.current
|
|
458
|
+
|
|
459
|
+
# Register cancel callback
|
|
460
|
+
cancel_callback_key = input.cancellation.add_cancel_callback do
|
|
461
|
+
# Send cancel if in start or pending
|
|
462
|
+
if @instance.pending_nexus_operation_starts.include?(seq) ||
|
|
463
|
+
@instance.pending_nexus_operations.include?(seq)
|
|
464
|
+
@instance.add_command(
|
|
465
|
+
Bridge::Api::WorkflowCommands::WorkflowCommand.new(
|
|
466
|
+
request_cancel_nexus_operation: Bridge::Api::WorkflowCommands::RequestCancelNexusOperation.new(
|
|
467
|
+
seq:
|
|
468
|
+
)
|
|
469
|
+
)
|
|
470
|
+
)
|
|
471
|
+
end
|
|
472
|
+
end
|
|
473
|
+
|
|
474
|
+
# Wait for start resolution
|
|
475
|
+
resolution = begin
|
|
476
|
+
Fiber.yield
|
|
477
|
+
ensure
|
|
478
|
+
# Remove pending start
|
|
479
|
+
@instance.pending_nexus_operation_starts.delete(seq)
|
|
480
|
+
end
|
|
481
|
+
|
|
482
|
+
# Handle start failure
|
|
483
|
+
if resolution.failed
|
|
484
|
+
input.cancellation.remove_cancel_callback(cancel_callback_key)
|
|
485
|
+
raise @instance.failure_converter.from_failure(resolution.failed, @instance.payload_converter)
|
|
486
|
+
end
|
|
487
|
+
|
|
488
|
+
# Create handle and add to pending operations (result will come via resolve_nexus_operation)
|
|
489
|
+
handle = NexusOperationHandle.new(
|
|
490
|
+
operation_token: resolution.operation_token,
|
|
491
|
+
instance: @instance,
|
|
492
|
+
cancellation: input.cancellation,
|
|
493
|
+
cancel_callback_key:,
|
|
494
|
+
result_hint: input.result_hint
|
|
495
|
+
)
|
|
496
|
+
@instance.pending_nexus_operations[seq] = handle
|
|
497
|
+
|
|
498
|
+
handle
|
|
499
|
+
end
|
|
411
500
|
end
|
|
412
501
|
end
|
|
413
502
|
end
|
|
@@ -23,7 +23,8 @@ module Temporalio
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def add(...)
|
|
26
|
-
if !@replay_safety_disabled && Temporalio::Workflow.in_workflow? &&
|
|
26
|
+
if !@replay_safety_disabled && Temporalio::Workflow.in_workflow? &&
|
|
27
|
+
Temporalio::Workflow::Unsafe.replaying_history_events?
|
|
27
28
|
return true
|
|
28
29
|
end
|
|
29
30
|
|
|
@@ -9,7 +9,8 @@ module Temporalio
|
|
|
9
9
|
# Wrapper for a metric that does not log on replay.
|
|
10
10
|
class ReplaySafeMetric < SimpleDelegator
|
|
11
11
|
def record(value, additional_attributes: nil)
|
|
12
|
-
return if Temporalio::Workflow.in_workflow? &&
|
|
12
|
+
return if Temporalio::Workflow.in_workflow? &&
|
|
13
|
+
Temporalio::Workflow::Unsafe.replaying_history_events?
|
|
13
14
|
|
|
14
15
|
super
|
|
15
16
|
end
|
|
@@ -78,7 +78,12 @@ module Temporalio
|
|
|
78
78
|
end
|
|
79
79
|
|
|
80
80
|
# This blocks until a resume is called on this fiber
|
|
81
|
-
result =
|
|
81
|
+
result = begin
|
|
82
|
+
Fiber.yield
|
|
83
|
+
ensure
|
|
84
|
+
# Remove pending
|
|
85
|
+
@wait_conditions.delete(seq)
|
|
86
|
+
end
|
|
82
87
|
|
|
83
88
|
# Remove cancellation callback (only needed on success)
|
|
84
89
|
cancellation&.remove_cancel_callback(cancel_callback_key) if cancel_callback_key
|
|
@@ -141,6 +146,10 @@ module Temporalio
|
|
|
141
146
|
fiber
|
|
142
147
|
end
|
|
143
148
|
|
|
149
|
+
def fiber_interrupt(fiber, exception)
|
|
150
|
+
fiber.raise(exception) if fiber.alive?
|
|
151
|
+
end
|
|
152
|
+
|
|
144
153
|
def io_wait(io, events, timeout)
|
|
145
154
|
# Do not allow if IO disabled
|
|
146
155
|
unless @instance.io_enabled
|
|
@@ -54,10 +54,12 @@ module Temporalio
|
|
|
54
54
|
|
|
55
55
|
attr_reader :context, :logger, :info, :scheduler, :disable_eager_activity_execution, :pending_activities,
|
|
56
56
|
:pending_timers, :pending_child_workflow_starts, :pending_child_workflows,
|
|
57
|
+
:pending_nexus_operation_starts, :pending_nexus_operations,
|
|
57
58
|
:pending_external_signals, :pending_external_cancels, :in_progress_handlers, :payload_converter,
|
|
58
59
|
:failure_converter, :cancellation, :continue_as_new_suggested, :current_deployment_version,
|
|
59
60
|
:current_history_length, :current_history_size, :replaying, :random,
|
|
60
|
-
:signal_handlers, :query_handlers, :update_handlers, :context_frozen, :assert_valid_local_activity
|
|
61
|
+
:signal_handlers, :query_handlers, :update_handlers, :context_frozen, :assert_valid_local_activity,
|
|
62
|
+
:in_query_or_validator
|
|
61
63
|
attr_accessor :io_enabled, :current_details
|
|
62
64
|
|
|
63
65
|
def initialize(details)
|
|
@@ -78,6 +80,8 @@ module Temporalio
|
|
|
78
80
|
@pending_timers = {} # Keyed by sequence, value is fiber to resume with proto result
|
|
79
81
|
@pending_child_workflow_starts = {} # Keyed by sequence, value is fiber to resume with proto result
|
|
80
82
|
@pending_child_workflows = {} # Keyed by sequence, value is ChildWorkflowHandle to resolve with proto result
|
|
83
|
+
@pending_nexus_operation_starts = {} # Keyed by sequence, value is fiber to resume with proto result
|
|
84
|
+
@pending_nexus_operations = {} # Keyed by sequence, value is NexusOperationHandle to resolve with proto result
|
|
81
85
|
@pending_external_signals = {} # Keyed by sequence, value is fiber to resume with proto result
|
|
82
86
|
@pending_external_cancels = {} # Keyed by sequence, value is fiber to resume with proto result
|
|
83
87
|
@buffered_signals = {} # Keyed by signal name, value is array of signal jobs
|
|
@@ -91,6 +95,7 @@ module Temporalio
|
|
|
91
95
|
@current_history_length = 0
|
|
92
96
|
@current_history_size = 0
|
|
93
97
|
@replaying = false
|
|
98
|
+
@in_query_or_validator = false
|
|
94
99
|
@workflow_failure_exception_types = details.workflow_failure_exception_types
|
|
95
100
|
@signal_handlers = HandlerHash.new(
|
|
96
101
|
details.definition.signals,
|
|
@@ -182,7 +187,7 @@ module Temporalio
|
|
|
182
187
|
# Apply jobs and run event loop
|
|
183
188
|
begin
|
|
184
189
|
# Create instance if it doesn't already exist
|
|
185
|
-
@instance ||= with_context_frozen { create_instance }
|
|
190
|
+
@instance ||= with_context_frozen(in_query_or_validator: false) { create_instance }
|
|
186
191
|
|
|
187
192
|
# Apply jobs
|
|
188
193
|
activation.jobs.each { |job| apply(job) }
|
|
@@ -345,7 +350,7 @@ module Temporalio
|
|
|
345
350
|
when :initialize_workflow
|
|
346
351
|
# Ignore
|
|
347
352
|
when :fire_timer
|
|
348
|
-
pending_timers
|
|
353
|
+
pending_timers[job.fire_timer.seq]&.resume
|
|
349
354
|
when :update_random_seed
|
|
350
355
|
@random = illegal_call_tracing_disabled { Random.new(job.update_random_seed.randomness_seed) }
|
|
351
356
|
when :query_workflow
|
|
@@ -356,23 +361,31 @@ module Temporalio
|
|
|
356
361
|
when :signal_workflow
|
|
357
362
|
apply_signal(job.signal_workflow)
|
|
358
363
|
when :resolve_activity
|
|
359
|
-
pending_activities
|
|
364
|
+
pending_activities[job.resolve_activity.seq]&.resume(job.resolve_activity.result)
|
|
360
365
|
when :notify_has_patch
|
|
361
366
|
@patches_notified << job.notify_has_patch.patch_id
|
|
362
367
|
when :resolve_child_workflow_execution_start
|
|
363
|
-
pending_child_workflow_starts
|
|
368
|
+
pending_child_workflow_starts[job.resolve_child_workflow_execution_start.seq]&.resume(
|
|
364
369
|
job.resolve_child_workflow_execution_start
|
|
365
370
|
)
|
|
366
371
|
when :resolve_child_workflow_execution
|
|
367
|
-
pending_child_workflows
|
|
372
|
+
pending_child_workflows[job.resolve_child_workflow_execution.seq]&._resolve(
|
|
368
373
|
job.resolve_child_workflow_execution.result
|
|
369
374
|
)
|
|
375
|
+
when :resolve_nexus_operation_start
|
|
376
|
+
pending_nexus_operation_starts[job.resolve_nexus_operation_start.seq]&.resume(
|
|
377
|
+
job.resolve_nexus_operation_start
|
|
378
|
+
)
|
|
379
|
+
when :resolve_nexus_operation
|
|
380
|
+
pending_nexus_operations[job.resolve_nexus_operation.seq]&._resolve(
|
|
381
|
+
job.resolve_nexus_operation.result
|
|
382
|
+
)
|
|
370
383
|
when :resolve_signal_external_workflow
|
|
371
|
-
pending_external_signals
|
|
384
|
+
pending_external_signals[job.resolve_signal_external_workflow.seq]&.resume(
|
|
372
385
|
job.resolve_signal_external_workflow
|
|
373
386
|
)
|
|
374
387
|
when :resolve_request_cancel_external_workflow
|
|
375
|
-
pending_external_cancels
|
|
388
|
+
pending_external_cancels[job.resolve_request_cancel_external_workflow.seq]&.resume(
|
|
376
389
|
job.resolve_request_cancel_external_workflow
|
|
377
390
|
)
|
|
378
391
|
when :do_update
|
|
@@ -439,7 +452,7 @@ module Temporalio
|
|
|
439
452
|
end
|
|
440
453
|
result_hint = defn.result_hint
|
|
441
454
|
|
|
442
|
-
with_context_frozen do
|
|
455
|
+
with_context_frozen(in_query_or_validator: true) do
|
|
443
456
|
@inbound.handle_query(
|
|
444
457
|
Temporalio::Worker::Interceptor::Workflow::HandleQueryInput.new(
|
|
445
458
|
id: job.query_id,
|
|
@@ -502,7 +515,7 @@ module Temporalio
|
|
|
502
515
|
# other SDKs, we are re-converting the args between validate and update to disallow user mutation in
|
|
503
516
|
# validator/interceptor.
|
|
504
517
|
if job.run_validator && defn.validator_to_invoke
|
|
505
|
-
with_context_frozen do
|
|
518
|
+
with_context_frozen(in_query_or_validator: true) do
|
|
506
519
|
@inbound.validate_update(
|
|
507
520
|
Temporalio::Worker::Interceptor::Workflow::HandleUpdateInput.new(
|
|
508
521
|
id: job.id,
|
|
@@ -663,11 +676,13 @@ module Temporalio
|
|
|
663
676
|
@definition_options.failure_exception_types&.any? { |cls| err.is_a?(cls) }
|
|
664
677
|
end
|
|
665
678
|
|
|
666
|
-
def with_context_frozen(&)
|
|
679
|
+
def with_context_frozen(in_query_or_validator:, &)
|
|
667
680
|
@context_frozen = true
|
|
681
|
+
@in_query_or_validator = in_query_or_validator
|
|
668
682
|
yield
|
|
669
683
|
ensure
|
|
670
684
|
@context_frozen = false
|
|
685
|
+
@in_query_or_validator = false
|
|
671
686
|
end
|
|
672
687
|
|
|
673
688
|
def convert_handler_args(payload_array:, defn:)
|