dex-python-sdk 0.0.2__cp311-abi3-win_amd64.whl
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.
- dex/__init__.py +146 -0
- dex/_grpc_errors.py +73 -0
- dex/_invocation_context.py +269 -0
- dex/_native.pyd +0 -0
- dex/_native.pyi +20 -0
- dex/_utils.py +18 -0
- dex/_value_hydrator.py +223 -0
- dex/_value_mapper.py +174 -0
- dex/_worker_dispatcher.py +451 -0
- dex/_worker_service.py +60 -0
- dex/attribute.py +87 -0
- dex/blob_cache.py +73 -0
- dex/channel.py +165 -0
- dex/client.py +715 -0
- dex/client_options.py +19 -0
- dex/codec.py +286 -0
- dex/command_request.py +120 -0
- dex/command_results.py +107 -0
- dex/communication.py +136 -0
- dex/communication_schema.py +54 -0
- dex/condition.py +74 -0
- dex/context.py +86 -0
- dex/data_attributes.py +70 -0
- dex/dexpb/__init__.py +1 -0
- dex/dexpb/dex_pb2.py +381 -0
- dex/dexpb/dex_pb2.pyi +1734 -0
- dex/dexpb/dex_pb2_grpc.py +1298 -0
- dex/errors.py +109 -0
- dex/flow.py +456 -0
- dex/flow_config.py +29 -0
- dex/flow_info.py +51 -0
- dex/flow_options.py +122 -0
- dex/object_encoder.py +799 -0
- dex/persistence.py +89 -0
- dex/persistence_options.py +12 -0
- dex/persistence_schema.py +51 -0
- dex/py.typed +1 -0
- dex/registry.py +204 -0
- dex/reset_workflow_type_and_options.py +67 -0
- dex/rpc.py +93 -0
- dex/runtime_errors.py +81 -0
- dex/search_attributes.py +184 -0
- dex/state_decision.py +153 -0
- dex/state_execution_locals.py +66 -0
- dex/state_movement.py +115 -0
- dex/state_schema.py +48 -0
- dex/step.py +194 -0
- dex/step_execution.py +42 -0
- dex/stop_workflow_options.py +18 -0
- dex/tests/__init__.py +80 -0
- dex/tests/dex-service-env/.env +7 -0
- dex/tests/dex-service-env/docker-compose-init.sh +44 -0
- dex/tests/dex-service-env/docker-compose.yml +97 -0
- dex/tests/dex-service-env/dynamicconfig/README.md +39 -0
- dex/tests/dex-service-env/dynamicconfig/development-sql.yaml +9 -0
- dex/tests/dex-service-env/dynamicconfig/docker.yaml +2 -0
- dex/tests/test_abnormal_exit_workflow.py +43 -0
- dex/tests/test_basic_workflow.py +70 -0
- dex/tests/test_conditional_complete.py +50 -0
- dex/tests/test_describe_workflow.py +40 -0
- dex/tests/test_empty_data_decodes_properly.py +74 -0
- dex/tests/test_internal_channel.py +28 -0
- dex/tests/test_internal_channel_with_no_prefix_channel.py +41 -0
- dex/tests/test_persistence_data_attributes.py +62 -0
- dex/tests/test_persistence_search_attributes.py +127 -0
- dex/tests/test_persistence_state_execution_locals.py +38 -0
- dex/tests/test_rpc.py +64 -0
- dex/tests/test_rpc_with_memo.py +195 -0
- dex/tests/test_rpc_with_memo_duplicate_java_tests.py +117 -0
- dex/tests/test_signal.py +51 -0
- dex/tests/test_skip_wait_until.py +76 -0
- dex/tests/test_state_failure_recovery.py +28 -0
- dex/tests/test_timer.py +35 -0
- dex/tests/test_wait_for_state_execution_completion.py +53 -0
- dex/tests/test_workflow_errors.py +87 -0
- dex/tests/test_workflow_state_options.py +118 -0
- dex/tests/test_workflow_state_options_override.py +44 -0
- dex/tests/worker_server.py +64 -0
- dex/tests/workflows/abnormal_exit_workflow.py +42 -0
- dex/tests/workflows/basic_workflow.py +62 -0
- dex/tests/workflows/conditional_complete_workflow.py +95 -0
- dex/tests/workflows/describe_workflow.py +46 -0
- dex/tests/workflows/empty_data_workflow.py +45 -0
- dex/tests/workflows/internal_channel_workflow.py +129 -0
- dex/tests/workflows/internal_channel_workflow_with_no_prefix_channel.py +100 -0
- dex/tests/workflows/java_duplicate_rpc_memo_workflow.py +276 -0
- dex/tests/workflows/persistence_data_attributes_workflow.py +98 -0
- dex/tests/workflows/persistence_search_attributes_workflow.py +159 -0
- dex/tests/workflows/persistence_state_execution_local_workflow.py +63 -0
- dex/tests/workflows/recovery_workflow.py +82 -0
- dex/tests/workflows/rpc_memo_workflow.py +231 -0
- dex/tests/workflows/rpc_workflow.py +117 -0
- dex/tests/workflows/state_options_override_workflow.py +93 -0
- dex/tests/workflows/state_options_workflow.py +84 -0
- dex/tests/workflows/timer_workflow.py +46 -0
- dex/tests/workflows/wait_for_state_with_state_execution_id_workflow.py +70 -0
- dex/tests/workflows/wait_for_state_with_wait_for_key_workflow.py +71 -0
- dex/tests/workflows/wait_internal_channel_workflow.py +47 -0
- dex/tests/workflows/wait_signal_workflow.py +147 -0
- dex/timer.py +21 -0
- dex/type_store.py +99 -0
- dex/unregistered_client.py +585 -0
- dex/utils/__init__.py +3 -0
- dex/utils/dex_typing.py +25 -0
- dex/utils/persistence_utils.py +32 -0
- dex/wait.py +49 -0
- dex/worker.py +121 -0
- dex/worker_options.py +22 -0
- dex/worker_service.py +432 -0
- dex/workflow.py +79 -0
- dex/workflow_context.py +44 -0
- dex/workflow_info.py +16 -0
- dex/workflow_options.py +74 -0
- dex/workflow_state.py +123 -0
- dex/workflow_state_options.py +154 -0
- dex_python_sdk-0.0.2.dist-info/METADATA +202 -0
- dex_python_sdk-0.0.2.dist-info/RECORD +121 -0
- dex_python_sdk-0.0.2.dist-info/WHEEL +4 -0
- dex_python_sdk-0.0.2.dist-info/licenses/LEGACY_NOTICES.md +61 -0
- dex_python_sdk-0.0.2.dist-info/licenses/LICENSE +192 -0
- dex_python_sdk-0.0.2.dist-info/sboms/dex-blob-cache-python.cyclonedx.json +2406 -0
dex/channel.py
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# Legacy Materials in this file remain under their original licenses.
|
|
2
|
+
# See LEGACY_NOTICES.md.
|
|
3
|
+
|
|
4
|
+
# Modifications Copyright (c) 2026 Super Durable, Inc.
|
|
5
|
+
#
|
|
6
|
+
# Modifications after the Legacy Cutoff are licensed under the
|
|
7
|
+
# Super Durable Source License 1.0.
|
|
8
|
+
# Legacy Materials remain under their original licenses.
|
|
9
|
+
# See LICENSE and LEGACY_NOTICES.md.
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
from dataclasses import dataclass
|
|
14
|
+
from typing import Generic, Sequence, TypeVar, cast
|
|
15
|
+
|
|
16
|
+
from dex._utils import require_name
|
|
17
|
+
from dex.condition import ChannelCondition, Condition
|
|
18
|
+
from dex.context import Context
|
|
19
|
+
|
|
20
|
+
ValueT = TypeVar("ValueT")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@dataclass(frozen=True)
|
|
24
|
+
class Channel(Generic[ValueT]):
|
|
25
|
+
name: str
|
|
26
|
+
value_type: type[ValueT]
|
|
27
|
+
|
|
28
|
+
def __post_init__(self) -> None:
|
|
29
|
+
require_name(self.name)
|
|
30
|
+
|
|
31
|
+
def publish(self, context: Context, value: ValueT) -> None:
|
|
32
|
+
context._publish_channel(self, None, value)
|
|
33
|
+
|
|
34
|
+
def size(self, context: Context) -> int:
|
|
35
|
+
return context._channel_size(cast(Channel[object], self), None)
|
|
36
|
+
|
|
37
|
+
def results(self, context: Context) -> Sequence[ValueT]:
|
|
38
|
+
return context._channel_results(self, None)
|
|
39
|
+
|
|
40
|
+
def for_one(self, *, condition_id: str | None = None) -> Condition:
|
|
41
|
+
return self.for_range(at_least=1, at_most=1, condition_id=condition_id)
|
|
42
|
+
|
|
43
|
+
def for_n(self, count: int, *, condition_id: str | None = None) -> Condition:
|
|
44
|
+
return self.for_range(
|
|
45
|
+
at_least=count,
|
|
46
|
+
at_most=count,
|
|
47
|
+
condition_id=condition_id,
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
def at_least(
|
|
51
|
+
self,
|
|
52
|
+
count: int,
|
|
53
|
+
*,
|
|
54
|
+
condition_id: str | None = None,
|
|
55
|
+
) -> Condition:
|
|
56
|
+
return self.for_range(at_least=count, condition_id=condition_id)
|
|
57
|
+
|
|
58
|
+
def at_most(
|
|
59
|
+
self,
|
|
60
|
+
count: int,
|
|
61
|
+
*,
|
|
62
|
+
condition_id: str | None = None,
|
|
63
|
+
) -> Condition:
|
|
64
|
+
return self.for_range(at_most=count, condition_id=condition_id)
|
|
65
|
+
|
|
66
|
+
def for_range(
|
|
67
|
+
self,
|
|
68
|
+
*,
|
|
69
|
+
at_least: int | None = None,
|
|
70
|
+
at_most: int | None = None,
|
|
71
|
+
condition_id: str | None = None,
|
|
72
|
+
) -> Condition:
|
|
73
|
+
return ChannelCondition(
|
|
74
|
+
condition_id=condition_id,
|
|
75
|
+
channel=self,
|
|
76
|
+
at_least=at_least,
|
|
77
|
+
at_most=at_most,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
@dataclass(frozen=True)
|
|
82
|
+
class ChannelMap(Generic[ValueT]):
|
|
83
|
+
name: str
|
|
84
|
+
value_type: type[ValueT]
|
|
85
|
+
|
|
86
|
+
def __post_init__(self) -> None:
|
|
87
|
+
require_name(self.name)
|
|
88
|
+
|
|
89
|
+
def publish(self, context: Context, instance: str, value: ValueT) -> None:
|
|
90
|
+
context._publish_channel(self, instance, value)
|
|
91
|
+
|
|
92
|
+
def size(self, context: Context, instance: str) -> int:
|
|
93
|
+
return context._channel_size(cast(ChannelMap[object], self), instance)
|
|
94
|
+
|
|
95
|
+
def results(self, context: Context, instance: str) -> Sequence[ValueT]:
|
|
96
|
+
return context._channel_results(self, instance)
|
|
97
|
+
|
|
98
|
+
def for_one(
|
|
99
|
+
self,
|
|
100
|
+
instance: str,
|
|
101
|
+
*,
|
|
102
|
+
condition_id: str | None = None,
|
|
103
|
+
) -> Condition:
|
|
104
|
+
return self.for_range(
|
|
105
|
+
instance,
|
|
106
|
+
at_least=1,
|
|
107
|
+
at_most=1,
|
|
108
|
+
condition_id=condition_id,
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
def for_n(
|
|
112
|
+
self,
|
|
113
|
+
instance: str,
|
|
114
|
+
count: int,
|
|
115
|
+
*,
|
|
116
|
+
condition_id: str | None = None,
|
|
117
|
+
) -> Condition:
|
|
118
|
+
return self.for_range(
|
|
119
|
+
instance,
|
|
120
|
+
at_least=count,
|
|
121
|
+
at_most=count,
|
|
122
|
+
condition_id=condition_id,
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
def at_least(
|
|
126
|
+
self,
|
|
127
|
+
instance: str,
|
|
128
|
+
count: int,
|
|
129
|
+
*,
|
|
130
|
+
condition_id: str | None = None,
|
|
131
|
+
) -> Condition:
|
|
132
|
+
return self.for_range(
|
|
133
|
+
instance,
|
|
134
|
+
at_least=count,
|
|
135
|
+
condition_id=condition_id,
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
def at_most(
|
|
139
|
+
self,
|
|
140
|
+
instance: str,
|
|
141
|
+
count: int,
|
|
142
|
+
*,
|
|
143
|
+
condition_id: str | None = None,
|
|
144
|
+
) -> Condition:
|
|
145
|
+
return self.for_range(
|
|
146
|
+
instance,
|
|
147
|
+
at_most=count,
|
|
148
|
+
condition_id=condition_id,
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
def for_range(
|
|
152
|
+
self,
|
|
153
|
+
instance: str,
|
|
154
|
+
*,
|
|
155
|
+
at_least: int | None = None,
|
|
156
|
+
at_most: int | None = None,
|
|
157
|
+
condition_id: str | None = None,
|
|
158
|
+
) -> Condition:
|
|
159
|
+
return ChannelCondition(
|
|
160
|
+
condition_id=condition_id,
|
|
161
|
+
channel=self,
|
|
162
|
+
instance=instance,
|
|
163
|
+
at_least=at_least,
|
|
164
|
+
at_most=at_most,
|
|
165
|
+
)
|