dex-python-sdk 1.45.4__tar.gz → 1.45.8__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.
Files changed (84) hide show
  1. dex_python_sdk-1.45.4/README.md → dex_python_sdk-1.45.8/PKG-INFO +43 -9
  2. dex_python_sdk-1.45.4/PKG-INFO → dex_python_sdk-1.45.8/README.md +26 -26
  3. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/__init__.py +2 -0
  4. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/_async_value_hydrator.py +7 -4
  5. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/_async_worker_dispatcher.py +1 -1
  6. dex_python_sdk-1.45.8/dex/_pull_slot_streams.py +945 -0
  7. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/_pull_worker.py +222 -107
  8. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/_value_hydrator.py +7 -4
  9. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/_worker_dispatcher.py +13 -1
  10. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/async_worker.py +42 -3
  11. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/pull_registration.py +129 -0
  12. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/worker.py +42 -3
  13. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/worker_options.py +116 -6
  14. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/pyproject.toml +1 -1
  15. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/sdk-rust/Cargo.lock +1 -0
  16. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/LEGACY_NOTICES.md +0 -0
  17. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/LICENSE +0 -0
  18. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/_attribute_reads.py +0 -0
  19. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/_credential_transport.py +0 -0
  20. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/_flow_definition_upload.py +0 -0
  21. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/_flow_service_tls.py +0 -0
  22. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/_grpc_errors.py +0 -0
  23. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/_history_point_mapping.py +0 -0
  24. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/_invocation_context.py +0 -0
  25. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/_message_size.py +0 -0
  26. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/_native.pyi +0 -0
  27. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/_server_protocol.py +0 -0
  28. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/_stop_flow_mapping.py +0 -0
  29. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/_task_queue_names.py +0 -0
  30. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/_utils.py +0 -0
  31. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/_value_mapper.py +0 -0
  32. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/action.py +0 -0
  33. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/async_client.py +0 -0
  34. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/attribute.py +0 -0
  35. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/attribute_match.py +0 -0
  36. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/attribute_values.py +0 -0
  37. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/blob_cache.py +0 -0
  38. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/channel.py +0 -0
  39. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/client.py +0 -0
  40. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/client_options.py +0 -0
  41. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/codec.py +0 -0
  42. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/condition.py +0 -0
  43. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/context.py +0 -0
  44. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/credential.py +0 -0
  45. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/dexpb/__init__.py +0 -0
  46. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/dexpb/dex_pb2.py +0 -0
  47. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/dexpb/dex_pb2.pyi +0 -0
  48. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/dexpb/dex_pb2_grpc.py +0 -0
  49. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/flow.py +0 -0
  50. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/flow_config.py +0 -0
  51. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/flow_definition.py +0 -0
  52. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/flow_info.py +0 -0
  53. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/flow_options.py +0 -0
  54. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/flow_result.py +0 -0
  55. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/flow_service_tls_options.py +0 -0
  56. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/flow_state.py +0 -0
  57. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/graceful_completion_context.py +0 -0
  58. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/join.py +0 -0
  59. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/py.typed +0 -0
  60. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/rpc_invoke_options.py +0 -0
  61. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/runtime_errors.py +0 -0
  62. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/step.py +0 -0
  63. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/step_execution.py +0 -0
  64. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/stream.py +0 -0
  65. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/subflow.py +0 -0
  66. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/timer.py +0 -0
  67. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/wait.py +0 -0
  68. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/dex/wait_options.py +0 -0
  69. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/sdk-rust/Cargo.toml +0 -0
  70. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/sdk-rust/crates/dex-blob-cache/Cargo.toml +0 -0
  71. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/sdk-rust/crates/dex-blob-cache/LICENSE +0 -0
  72. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/sdk-rust/crates/dex-blob-cache/README.md +0 -0
  73. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/sdk-rust/crates/dex-blob-cache/src/config.rs +0 -0
  74. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/sdk-rust/crates/dex-blob-cache/src/entry.rs +0 -0
  75. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/sdk-rust/crates/dex-blob-cache/src/error.rs +0 -0
  76. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/sdk-rust/crates/dex-blob-cache/src/format.rs +0 -0
  77. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/sdk-rust/crates/dex-blob-cache/src/lib.rs +0 -0
  78. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/sdk-rust/crates/dex-blob-cache/src/policy.rs +0 -0
  79. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/sdk-rust/crates/dex-blob-cache/src/store.rs +0 -0
  80. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/sdk-rust/crates/dex-blob-cache/tests/blob_cache_integration.rs +0 -0
  81. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/sdk-rust/crates/dex-blob-cache-python/Cargo.toml +0 -0
  82. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/sdk-rust/crates/dex-blob-cache-python/LICENSE +0 -0
  83. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/sdk-rust/crates/dex-blob-cache-python/README.md +0 -0
  84. {dex_python_sdk-1.45.4 → dex_python_sdk-1.45.8}/sdk-rust/crates/dex-blob-cache-python/src/lib.rs +0 -0
@@ -1,3 +1,19 @@
1
+ Metadata-Version: 2.4
2
+ Name: dex-python-sdk
3
+ Version: 1.45.8
4
+ Requires-Dist: grpcio>=1.83.0
5
+ Requires-Dist: grpcio-status>=1.83.0
6
+ Requires-Dist: protobuf>=7.35.1
7
+ License-File: LICENSE
8
+ License-File: LEGACY_NOTICES.md
9
+ Summary: Python SDK for the Dex workflow engine
10
+ Author: Super Durable
11
+ License-Expression: LicenseRef-Sustainable-Use-1.0
12
+ Requires-Python: >=3.11
13
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
14
+ Project-URL: Homepage, https://github.com/superdurable/dex/tree/main/sdk-python
15
+ Project-URL: Repository, https://github.com/superdurable/dex
16
+
1
17
 
2
18
  # Dex SDK for Python
3
19
 
@@ -215,15 +231,32 @@ finally:
215
231
  worker_thread.join()
216
232
  ```
217
233
 
218
- The Worker opens exactly `max_concurrent_tasks` long-lived streams. Each stream
219
- is one execution slot serving the sticky queue and every registered Flow type.
220
- Flow type names must be unique within a Dex server. Concurrency defaults to the
221
- CPU count. Start fails if the configured concurrency exceeds the Server's
222
- reported `matching.maxConcurrentTasksCap`; zero means no limit was reported.
223
- The Worker checks the limit on its first registration only. It then half-closes
224
- its streams, drops any task they receive, and never reports readiness;
225
- registration waiters raise the limit error. A lower limit reported on a later
226
- reconnect is logged as a warning, and the Worker keeps running.
234
+ By default the Worker is fixed: it opens exactly `max_concurrent_tasks`
235
+ long-lived streams. Each stream is one execution slot serving the sticky queue
236
+ and every registered Flow type. Flow type names must be unique within a Dex
237
+ server. Concurrency defaults to the CPU count. Start fails if an explicit
238
+ `max_concurrent_tasks` exceeds the Server's reported
239
+ `matching.maxConcurrentTasksCap`; zero means no limit was reported. With
240
+ `max_concurrent_tasks` unset, the Worker opens one stream first and clamps its
241
+ CPU-count default to the cap with a warning. The Worker checks the limit on
242
+ its first registration only. After a failed check it half-closes its streams,
243
+ drops any task they receive, and never reports readiness; registration waiters
244
+ raise the limit error. A lower limit reported on a later reconnect is logged as
245
+ a warning, and the Worker keeps running.
246
+
247
+ Set `min_open_slots` below `max_concurrent_tasks` to make the Worker adaptive.
248
+ It then keeps between `min_open_slots` and `max_concurrent_tasks` slot streams
249
+ open, both counting the reserved RPC slots, so an idle Worker holds fewer
250
+ Server streams. It doubles its Step-and-RPC streams when a task takes the last
251
+ idle one and half-closes half of the idle surplus every 30 seconds. An adaptive
252
+ Worker clamps `max_concurrent_tasks` to the Server cap with a warning instead
253
+ of failing start. `worker.pull_slot_stream_state()` returns a snapshot of the
254
+ open, busy, and idle streams.
255
+
256
+ ```python
257
+ # Between 8 and 64 slot streams, one of them reserved for RPCs.
258
+ pull = PullWorkerOptions(max_concurrent_tasks=64, min_open_slots=8)
259
+ ```
227
260
  `idle_streams_per_queue` is deprecated, remains accepted, and has no effect.
228
261
  Each slot executes every task it receives and never rejects a task for capacity.
229
262
  Step heartbeats and stream writes use the same stream. Busy streams send a Pong
@@ -1170,3 +1203,4 @@ original terms as described in [LEGACY_NOTICES.md](LEGACY_NOTICES.md).
1170
1203
 
1171
1204
  Searches return runs that match the query. Include `FlowType` when using shared
1172
1205
  index slots, and keep the query and page size consistent across pages.
1206
+
@@ -1,19 +1,3 @@
1
- Metadata-Version: 2.4
2
- Name: dex-python-sdk
3
- Version: 1.45.4
4
- Requires-Dist: grpcio>=1.83.0
5
- Requires-Dist: grpcio-status>=1.83.0
6
- Requires-Dist: protobuf>=7.35.1
7
- License-File: LICENSE
8
- License-File: LEGACY_NOTICES.md
9
- Summary: Python SDK for the Dex workflow engine
10
- Author: Super Durable
11
- License-Expression: LicenseRef-Sustainable-Use-1.0
12
- Requires-Python: >=3.11
13
- Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
14
- Project-URL: Homepage, https://github.com/superdurable/dex/tree/main/sdk-python
15
- Project-URL: Repository, https://github.com/superdurable/dex
16
-
17
1
 
18
2
  # Dex SDK for Python
19
3
 
@@ -231,15 +215,32 @@ finally:
231
215
  worker_thread.join()
232
216
  ```
233
217
 
234
- The Worker opens exactly `max_concurrent_tasks` long-lived streams. Each stream
235
- is one execution slot serving the sticky queue and every registered Flow type.
236
- Flow type names must be unique within a Dex server. Concurrency defaults to the
237
- CPU count. Start fails if the configured concurrency exceeds the Server's
238
- reported `matching.maxConcurrentTasksCap`; zero means no limit was reported.
239
- The Worker checks the limit on its first registration only. It then half-closes
240
- its streams, drops any task they receive, and never reports readiness;
241
- registration waiters raise the limit error. A lower limit reported on a later
242
- reconnect is logged as a warning, and the Worker keeps running.
218
+ By default the Worker is fixed: it opens exactly `max_concurrent_tasks`
219
+ long-lived streams. Each stream is one execution slot serving the sticky queue
220
+ and every registered Flow type. Flow type names must be unique within a Dex
221
+ server. Concurrency defaults to the CPU count. Start fails if an explicit
222
+ `max_concurrent_tasks` exceeds the Server's reported
223
+ `matching.maxConcurrentTasksCap`; zero means no limit was reported. With
224
+ `max_concurrent_tasks` unset, the Worker opens one stream first and clamps its
225
+ CPU-count default to the cap with a warning. The Worker checks the limit on
226
+ its first registration only. After a failed check it half-closes its streams,
227
+ drops any task they receive, and never reports readiness; registration waiters
228
+ raise the limit error. A lower limit reported on a later reconnect is logged as
229
+ a warning, and the Worker keeps running.
230
+
231
+ Set `min_open_slots` below `max_concurrent_tasks` to make the Worker adaptive.
232
+ It then keeps between `min_open_slots` and `max_concurrent_tasks` slot streams
233
+ open, both counting the reserved RPC slots, so an idle Worker holds fewer
234
+ Server streams. It doubles its Step-and-RPC streams when a task takes the last
235
+ idle one and half-closes half of the idle surplus every 30 seconds. An adaptive
236
+ Worker clamps `max_concurrent_tasks` to the Server cap with a warning instead
237
+ of failing start. `worker.pull_slot_stream_state()` returns a snapshot of the
238
+ open, busy, and idle streams.
239
+
240
+ ```python
241
+ # Between 8 and 64 slot streams, one of them reserved for RPCs.
242
+ pull = PullWorkerOptions(max_concurrent_tasks=64, min_open_slots=8)
243
+ ```
243
244
  `idle_streams_per_queue` is deprecated, remains accepted, and has no effect.
244
245
  Each slot executes every task it receives and never rejects a task for capacity.
245
246
  Step heartbeats and stream writes use the same stream. Busy streams send a Pong
@@ -1186,4 +1187,3 @@ original terms as described in [LEGACY_NOTICES.md](LEGACY_NOTICES.md).
1186
1187
 
1187
1188
  Searches return runs that match the query. Include `FlowType` when using shared
1188
1189
  index slots, and keep the query and page size consistent across pages.
1189
-
@@ -104,6 +104,7 @@ from dex.pull_registration import (
104
104
  PullQueueRegistrationState,
105
105
  PullRegistrationError,
106
106
  PullRegistrationState,
107
+ PullSlotStreamState,
107
108
  )
108
109
  from dex.rpc_invoke_options import RPCInvokeOptions
109
110
  from dex.runtime_errors import (
@@ -298,6 +299,7 @@ __all__ = [
298
299
  "PullRegistrationError",
299
300
  "PullRegistrationState",
300
301
  "PullQueueRegistrationState",
302
+ "PullSlotStreamState",
301
303
  "WaitForAttributeOptions",
302
304
  "WaitForStepCompletionOptions",
303
305
  "dead_end",
@@ -177,16 +177,19 @@ class AsyncValueHydrator:
177
177
  ) -> pb.InvokeWorkerRPCRequest:
178
178
  result = pb.InvokeWorkerRPCRequest()
179
179
  result.CopyFrom(request)
180
- values = [request.input, *(entry.value for entry in request.attributes)]
180
+ # Released TypeScript Clients leave the input of an input-free RPC unset.
181
+ has_input = request.HasField("input")
182
+ values = [request.input] if has_input else []
183
+ values.extend(entry.value for entry in request.attributes)
181
184
  channel_messages = [
182
185
  message
183
186
  for channel_values in request.loaded_channel_messages.values()
184
187
  for message in channel_values.messages
185
188
  ]
186
189
  values.extend(message.value for message in channel_messages)
187
- hydrated = await self.hydrate_all(request.context.flow_id, values)
188
- result.input.CopyFrom(hydrated[0])
189
- hydrated_entries = iter(hydrated[1:])
190
+ hydrated_entries = iter(await self.hydrate_all(request.context.flow_id, values))
191
+ if has_input:
192
+ result.input.CopyFrom(next(hydrated_entries))
190
193
  for entry in result.attributes:
191
194
  entry.value.CopyFrom(next(hydrated_entries))
192
195
  result_messages = [
@@ -386,7 +386,7 @@ class AsyncWorkerDispatcher(WorkerDispatcher):
386
386
  )
387
387
  arguments: list[object] = [context]
388
388
  if rpc.input_codec is not None:
389
- arguments.append(self._values.decode(request.input, rpc.input_codec))
389
+ arguments.append(self._decode_rpc_input(request, rpc.input_codec))
390
390
  returned: Any = rpc.method(*arguments)
391
391
  if isawaitable(returned):
392
392
  returned = await returned