Skip to content

Commit f252e36

Browse files
authored
Expose core "runtime" as temporalio.runtime.Runtime (#240)
Fixes #230
1 parent 57bf9e6 commit f252e36

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1448
-809
lines changed

temporalio/api/batch/v1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
from .message_pb2 import (
22
BatchOperationCancellation,
3+
BatchOperationDeletion,
34
BatchOperationInfo,
45
BatchOperationSignal,
56
BatchOperationTermination,
67
)
78

89
__all__ = [
910
"BatchOperationCancellation",
11+
"BatchOperationDeletion",
1012
"BatchOperationInfo",
1113
"BatchOperationSignal",
1214
"BatchOperationTermination",

temporalio/api/batch/v1/message_pb2.py

Lines changed: 16 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporalio/api/batch/v1/message_pb2.pyi

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,3 +190,24 @@ class BatchOperationCancellation(google.protobuf.message.Message):
190190
) -> None: ...
191191

192192
global___BatchOperationCancellation = BatchOperationCancellation
193+
194+
class BatchOperationDeletion(google.protobuf.message.Message):
195+
"""BatchOperationDeletion sends deletion requests to batch workflows.
196+
Keep the parameter in sync with temporalio.api.workflowservice.v1.DeleteWorkflowExecutionRequest.
197+
"""
198+
199+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
200+
201+
IDENTITY_FIELD_NUMBER: builtins.int
202+
identity: builtins.str
203+
"""The identity of the worker/client"""
204+
def __init__(
205+
self,
206+
*,
207+
identity: builtins.str = ...,
208+
) -> None: ...
209+
def ClearField(
210+
self, field_name: typing_extensions.Literal["identity", b"identity"]
211+
) -> None: ...
212+
213+
global___BatchOperationDeletion = BatchOperationDeletion

temporalio/api/command/v1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
FailWorkflowExecutionCommandAttributes,
1010
ModifyWorkflowPropertiesCommandAttributes,
1111
RecordMarkerCommandAttributes,
12+
RejectWorkflowUpdateCommandAttributes,
1213
RequestCancelActivityTaskCommandAttributes,
1314
RequestCancelExternalWorkflowExecutionCommandAttributes,
1415
ScheduleActivityTaskCommandAttributes,
@@ -29,6 +30,7 @@
2930
"FailWorkflowExecutionCommandAttributes",
3031
"ModifyWorkflowPropertiesCommandAttributes",
3132
"RecordMarkerCommandAttributes",
33+
"RejectWorkflowUpdateCommandAttributes",
3234
"RequestCancelActivityTaskCommandAttributes",
3335
"RequestCancelExternalWorkflowExecutionCommandAttributes",
3436
"ScheduleActivityTaskCommandAttributes",

temporalio/api/command/v1/message_pb2.py

Lines changed: 57 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporalio/api/command/v1/message_pb2.pyi

Lines changed: 59 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ import google.protobuf.message
3232
import sys
3333
import temporalio.api.common.v1.message_pb2
3434
import temporalio.api.enums.v1.command_type_pb2
35-
import temporalio.api.enums.v1.update_pb2
3635
import temporalio.api.enums.v1.workflow_pb2
3736
import temporalio.api.failure.v1.message_pb2
37+
import temporalio.api.interaction.v1.message_pb2
3838
import temporalio.api.taskqueue.v1.message_pb2
3939

4040
if sys.version_info >= (3, 8):
@@ -858,77 +858,81 @@ global___StartChildWorkflowExecutionCommandAttributes = (
858858
class AcceptWorkflowUpdateCommandAttributes(google.protobuf.message.Message):
859859
DESCRIPTOR: google.protobuf.descriptor.Descriptor
860860

861-
UPDATE_ID_FIELD_NUMBER: builtins.int
862-
update_id: builtins.str
863-
"""A unique identifier for an update within a given workflow context"""
861+
META_FIELD_NUMBER: builtins.int
862+
INPUT_FIELD_NUMBER: builtins.int
863+
@property
864+
def meta(self) -> temporalio.api.interaction.v1.message_pb2.Meta: ...
865+
@property
866+
def input(self) -> temporalio.api.interaction.v1.message_pb2.Input: ...
864867
def __init__(
865868
self,
866869
*,
867-
update_id: builtins.str = ...,
870+
meta: temporalio.api.interaction.v1.message_pb2.Meta | None = ...,
871+
input: temporalio.api.interaction.v1.message_pb2.Input | None = ...,
868872
) -> None: ...
873+
def HasField(
874+
self, field_name: typing_extensions.Literal["input", b"input", "meta", b"meta"]
875+
) -> builtins.bool: ...
869876
def ClearField(
870-
self, field_name: typing_extensions.Literal["update_id", b"update_id"]
877+
self, field_name: typing_extensions.Literal["input", b"input", "meta", b"meta"]
871878
) -> None: ...
872879

873880
global___AcceptWorkflowUpdateCommandAttributes = AcceptWorkflowUpdateCommandAttributes
874881

875882
class CompleteWorkflowUpdateCommandAttributes(google.protobuf.message.Message):
876883
DESCRIPTOR: google.protobuf.descriptor.Descriptor
877884

878-
UPDATE_ID_FIELD_NUMBER: builtins.int
879-
DURABILITY_PREFERENCE_FIELD_NUMBER: builtins.int
880-
SUCCESS_FIELD_NUMBER: builtins.int
881-
FAILURE_FIELD_NUMBER: builtins.int
882-
update_id: builtins.str
883-
"""A unique identifier for an update within a given workflow context"""
884-
durability_preference: temporalio.api.enums.v1.update_pb2.WorkflowUpdateDurabilityPreference.ValueType
885-
"""Whether the server should attempt to bypass making this update rejection
886-
durable in history. This field is only consulted when the result field
887-
indicates failure. Leaving this field in its default state (i.e.
888-
UPDATE_WORKFLOW_REJECTION_DURABILITY_PREFERENCE_UNSPECIFIED) will result
889-
in making the rejection durable.
890-
"""
885+
META_FIELD_NUMBER: builtins.int
886+
OUTPUT_FIELD_NUMBER: builtins.int
891887
@property
892-
def success(self) -> temporalio.api.common.v1.message_pb2.Payloads: ...
888+
def meta(self) -> temporalio.api.interaction.v1.message_pb2.Meta: ...
893889
@property
894-
def failure(self) -> temporalio.api.failure.v1.message_pb2.Failure: ...
890+
def output(self) -> temporalio.api.interaction.v1.message_pb2.Output: ...
895891
def __init__(
896892
self,
897893
*,
898-
update_id: builtins.str = ...,
899-
durability_preference: temporalio.api.enums.v1.update_pb2.WorkflowUpdateDurabilityPreference.ValueType = ...,
900-
success: temporalio.api.common.v1.message_pb2.Payloads | None = ...,
901-
failure: temporalio.api.failure.v1.message_pb2.Failure | None = ...,
894+
meta: temporalio.api.interaction.v1.message_pb2.Meta | None = ...,
895+
output: temporalio.api.interaction.v1.message_pb2.Output | None = ...,
902896
) -> None: ...
903897
def HasField(
904898
self,
905-
field_name: typing_extensions.Literal[
906-
"failure", b"failure", "result", b"result", "success", b"success"
907-
],
899+
field_name: typing_extensions.Literal["meta", b"meta", "output", b"output"],
908900
) -> builtins.bool: ...
909901
def ClearField(
910902
self,
911-
field_name: typing_extensions.Literal[
912-
"durability_preference",
913-
b"durability_preference",
914-
"failure",
915-
b"failure",
916-
"result",
917-
b"result",
918-
"success",
919-
b"success",
920-
"update_id",
921-
b"update_id",
922-
],
903+
field_name: typing_extensions.Literal["meta", b"meta", "output", b"output"],
923904
) -> None: ...
924-
def WhichOneof(
925-
self, oneof_group: typing_extensions.Literal["result", b"result"]
926-
) -> typing_extensions.Literal["success", "failure"] | None: ...
927905

928906
global___CompleteWorkflowUpdateCommandAttributes = (
929907
CompleteWorkflowUpdateCommandAttributes
930908
)
931909

910+
class RejectWorkflowUpdateCommandAttributes(google.protobuf.message.Message):
911+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
912+
913+
META_FIELD_NUMBER: builtins.int
914+
FAILURE_FIELD_NUMBER: builtins.int
915+
@property
916+
def meta(self) -> temporalio.api.interaction.v1.message_pb2.Meta: ...
917+
@property
918+
def failure(self) -> temporalio.api.failure.v1.message_pb2.Failure: ...
919+
def __init__(
920+
self,
921+
*,
922+
meta: temporalio.api.interaction.v1.message_pb2.Meta | None = ...,
923+
failure: temporalio.api.failure.v1.message_pb2.Failure | None = ...,
924+
) -> None: ...
925+
def HasField(
926+
self,
927+
field_name: typing_extensions.Literal["failure", b"failure", "meta", b"meta"],
928+
) -> builtins.bool: ...
929+
def ClearField(
930+
self,
931+
field_name: typing_extensions.Literal["failure", b"failure", "meta", b"meta"],
932+
) -> None: ...
933+
934+
global___RejectWorkflowUpdateCommandAttributes = RejectWorkflowUpdateCommandAttributes
935+
932936
class Command(google.protobuf.message.Message):
933937
DESCRIPTOR: google.protobuf.descriptor.Descriptor
934938

@@ -949,6 +953,7 @@ class Command(google.protobuf.message.Message):
949953
ACCEPT_WORKFLOW_UPDATE_COMMAND_ATTRIBUTES_FIELD_NUMBER: builtins.int
950954
COMPLETE_WORKFLOW_UPDATE_COMMAND_ATTRIBUTES_FIELD_NUMBER: builtins.int
951955
MODIFY_WORKFLOW_PROPERTIES_COMMAND_ATTRIBUTES_FIELD_NUMBER: builtins.int
956+
REJECT_WORKFLOW_UPDATE_COMMAND_ATTRIBUTES_FIELD_NUMBER: builtins.int
952957
command_type: temporalio.api.enums.v1.command_type_pb2.CommandType.ValueType
953958
@property
954959
def schedule_activity_task_command_attributes(
@@ -1014,6 +1019,10 @@ class Command(google.protobuf.message.Message):
10141019
def modify_workflow_properties_command_attributes(
10151020
self,
10161021
) -> global___ModifyWorkflowPropertiesCommandAttributes: ...
1022+
@property
1023+
def reject_workflow_update_command_attributes(
1024+
self,
1025+
) -> global___RejectWorkflowUpdateCommandAttributes: ...
10171026
def __init__(
10181027
self,
10191028
*,
@@ -1050,6 +1059,8 @@ class Command(google.protobuf.message.Message):
10501059
| None = ...,
10511060
modify_workflow_properties_command_attributes: global___ModifyWorkflowPropertiesCommandAttributes
10521061
| None = ...,
1062+
reject_workflow_update_command_attributes: global___RejectWorkflowUpdateCommandAttributes
1063+
| None = ...,
10531064
) -> None: ...
10541065
def HasField(
10551066
self,
@@ -1074,6 +1085,8 @@ class Command(google.protobuf.message.Message):
10741085
b"modify_workflow_properties_command_attributes",
10751086
"record_marker_command_attributes",
10761087
b"record_marker_command_attributes",
1088+
"reject_workflow_update_command_attributes",
1089+
b"reject_workflow_update_command_attributes",
10771090
"request_cancel_activity_task_command_attributes",
10781091
b"request_cancel_activity_task_command_attributes",
10791092
"request_cancel_external_workflow_execution_command_attributes",
@@ -1115,6 +1128,8 @@ class Command(google.protobuf.message.Message):
11151128
b"modify_workflow_properties_command_attributes",
11161129
"record_marker_command_attributes",
11171130
b"record_marker_command_attributes",
1131+
"reject_workflow_update_command_attributes",
1132+
b"reject_workflow_update_command_attributes",
11181133
"request_cancel_activity_task_command_attributes",
11191134
b"request_cancel_activity_task_command_attributes",
11201135
"request_cancel_external_workflow_execution_command_attributes",
@@ -1150,6 +1165,7 @@ class Command(google.protobuf.message.Message):
11501165
"accept_workflow_update_command_attributes",
11511166
"complete_workflow_update_command_attributes",
11521167
"modify_workflow_properties_command_attributes",
1168+
"reject_workflow_update_command_attributes",
11531169
] | None: ...
11541170

11551171
global___Command = Command

temporalio/api/common/v1/message_pb2.py

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)