durabletask 1.1.0.dev1__tar.gz → 1.1.0.dev2__tar.gz
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.
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/PKG-INFO +1 -1
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask/entities/entity_instance_id.py +8 -6
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask/entities/entity_metadata.py +3 -2
- durabletask-1.1.0.dev2/durabletask/py.typed +0 -0
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask/task.py +2 -1
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask/worker.py +11 -9
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask.egg-info/PKG-INFO +1 -1
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask.egg-info/SOURCES.txt +1 -0
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/pyproject.toml +1 -1
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/LICENSE +0 -0
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/README.md +0 -0
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask/__init__.py +0 -0
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask/client.py +0 -0
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask/entities/__init__.py +0 -0
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask/entities/durable_entity.py +0 -0
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask/entities/entity_context.py +0 -0
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask/entities/entity_lock.py +0 -0
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask/internal/entity_state_shim.py +0 -0
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask/internal/exceptions.py +0 -0
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask/internal/grpc_interceptor.py +0 -0
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask/internal/helpers.py +0 -0
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask/internal/orchestration_entity_context.py +0 -0
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask/internal/orchestrator_service_pb2.py +0 -0
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask/internal/orchestrator_service_pb2.pyi +0 -0
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask/internal/orchestrator_service_pb2_grpc.py +0 -0
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask/internal/shared.py +0 -0
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask.egg-info/dependency_links.txt +0 -0
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask.egg-info/requires.txt +0 -0
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask.egg-info/top_level.txt +0 -0
- {durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/setup.cfg +0 -0
{durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask/entities/entity_instance_id.py
RENAMED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
from typing import Optional
|
|
2
|
-
|
|
3
|
-
|
|
4
1
|
class EntityInstanceId:
|
|
5
2
|
def __init__(self, entity: str, key: str):
|
|
6
3
|
self.entity = entity
|
|
@@ -20,7 +17,7 @@ class EntityInstanceId:
|
|
|
20
17
|
return str(self) < str(other)
|
|
21
18
|
|
|
22
19
|
@staticmethod
|
|
23
|
-
def parse(entity_id: str) ->
|
|
20
|
+
def parse(entity_id: str) -> "EntityInstanceId":
|
|
24
21
|
"""Parse a string representation of an entity ID into an EntityInstanceId object.
|
|
25
22
|
|
|
26
23
|
Parameters
|
|
@@ -30,8 +27,13 @@ class EntityInstanceId:
|
|
|
30
27
|
|
|
31
28
|
Returns
|
|
32
29
|
-------
|
|
33
|
-
|
|
34
|
-
The parsed EntityInstanceId object
|
|
30
|
+
EntityInstanceId
|
|
31
|
+
The parsed EntityInstanceId object.
|
|
32
|
+
|
|
33
|
+
Raises
|
|
34
|
+
------
|
|
35
|
+
ValueError
|
|
36
|
+
If the input string is not in the correct format.
|
|
35
37
|
"""
|
|
36
38
|
try:
|
|
37
39
|
_, entity, key = entity_id.split("@", 2)
|
|
@@ -44,8 +44,9 @@ class EntityMetadata:
|
|
|
44
44
|
|
|
45
45
|
@staticmethod
|
|
46
46
|
def from_entity_response(entity_response: pb.GetEntityResponse, includes_state: bool):
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
try:
|
|
48
|
+
entity_id = EntityInstanceId.parse(entity_response.entity.instanceId)
|
|
49
|
+
except ValueError:
|
|
49
50
|
raise ValueError("Invalid entity instance ID in entity response.")
|
|
50
51
|
entity_state = None
|
|
51
52
|
if includes_state:
|
|
File without changes
|
|
@@ -139,7 +139,8 @@ class OrchestrationContext(ABC):
|
|
|
139
139
|
pass
|
|
140
140
|
|
|
141
141
|
@abstractmethod
|
|
142
|
-
def call_entity(self,
|
|
142
|
+
def call_entity(self,
|
|
143
|
+
entity: EntityInstanceId,
|
|
143
144
|
operation: str,
|
|
144
145
|
input: Optional[TInput] = None) -> Task:
|
|
145
146
|
"""Schedule entity function for execution.
|
|
@@ -750,9 +750,10 @@ class TaskHubGrpcWorker:
|
|
|
750
750
|
for operation in req.operations:
|
|
751
751
|
start_time = datetime.now(timezone.utc)
|
|
752
752
|
executor = _EntityExecutor(self._registry, self._logger)
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
753
|
+
try:
|
|
754
|
+
entity_instance_id = EntityInstanceId.parse(instance_id)
|
|
755
|
+
except ValueError:
|
|
756
|
+
raise RuntimeError(f"Invalid entity instance ID '{instance_id}' in entity operation request.")
|
|
756
757
|
|
|
757
758
|
operation_result = None
|
|
758
759
|
|
|
@@ -1038,14 +1039,14 @@ class _RuntimeOrchestrationContext(task.OrchestrationContext):
|
|
|
1038
1039
|
|
|
1039
1040
|
def call_entity(
|
|
1040
1041
|
self,
|
|
1041
|
-
|
|
1042
|
+
entity: EntityInstanceId,
|
|
1042
1043
|
operation: str,
|
|
1043
1044
|
input: Optional[TInput] = None,
|
|
1044
1045
|
) -> task.Task:
|
|
1045
1046
|
id = self.next_sequence_number()
|
|
1046
1047
|
|
|
1047
1048
|
self.call_entity_function_helper(
|
|
1048
|
-
id,
|
|
1049
|
+
id, entity, operation, input=input
|
|
1049
1050
|
)
|
|
1050
1051
|
|
|
1051
1052
|
return self._pending_tasks.get(id, task.CompletableTask())
|
|
@@ -1053,13 +1054,13 @@ class _RuntimeOrchestrationContext(task.OrchestrationContext):
|
|
|
1053
1054
|
def signal_entity(
|
|
1054
1055
|
self,
|
|
1055
1056
|
entity_id: EntityInstanceId,
|
|
1056
|
-
|
|
1057
|
+
operation_name: str,
|
|
1057
1058
|
input: Optional[TInput] = None
|
|
1058
1059
|
) -> None:
|
|
1059
1060
|
id = self.next_sequence_number()
|
|
1060
1061
|
|
|
1061
1062
|
self.signal_entity_function_helper(
|
|
1062
|
-
id, entity_id,
|
|
1063
|
+
id, entity_id, operation_name, input
|
|
1063
1064
|
)
|
|
1064
1065
|
|
|
1065
1066
|
def lock_entities(self, entities: list[EntityInstanceId]) -> task.Task[EntityLock]:
|
|
@@ -1656,8 +1657,9 @@ class _OrchestrationExecutor:
|
|
|
1656
1657
|
raise _get_wrong_action_type_error(
|
|
1657
1658
|
entity_call_id, expected_method_name, action
|
|
1658
1659
|
)
|
|
1659
|
-
|
|
1660
|
-
|
|
1660
|
+
try:
|
|
1661
|
+
entity_id = EntityInstanceId.parse(event.entityOperationCalled.targetInstanceId.value)
|
|
1662
|
+
except ValueError:
|
|
1661
1663
|
raise RuntimeError(f"Could not parse entity ID from targetInstanceId '{event.entityOperationCalled.targetInstanceId.value}'")
|
|
1662
1664
|
ctx._entity_task_id_map[event.entityOperationCalled.requestId] = (entity_id, entity_call_id)
|
|
1663
1665
|
elif event.HasField("entityOperationSignaled"):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask/internal/orchestrator_service_pb2.py
RENAMED
|
File without changes
|
{durabletask-1.1.0.dev1 → durabletask-1.1.0.dev2}/durabletask/internal/orchestrator_service_pb2.pyi
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|