dex-python-sdk 0.2.4__tar.gz → 0.2.5__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.
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/PKG-INFO +1 -1
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/__init__.py +3 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/_grpc_errors.py +29 -1
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/pyproject.toml +1 -1
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/LEGACY_NOTICES.md +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/LICENSE +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/README.md +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/_async_value_hydrator.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/_async_worker_dispatcher.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/_async_worker_service.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/_invocation_context.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/_native.pyi +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/_utils.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/_value_hydrator.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/_value_mapper.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/_worker_dispatcher.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/_worker_service.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/async_client.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/async_worker.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/attribute.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/blob_cache.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/channel.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/client.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/client_options.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/codec.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/condition.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/context.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/dexpb/__init__.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/dexpb/dex_pb2.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/dexpb/dex_pb2.pyi +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/dexpb/dex_pb2_grpc.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/flow.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/flow_config.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/flow_info.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/flow_options.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/flow_result.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/py.typed +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/runtime_errors.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/step.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/step_execution.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/stream.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/subflow.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/timer.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/wait.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/worker.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/dex/worker_options.py +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/sdk-rust/Cargo.lock +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/sdk-rust/Cargo.toml +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache/Cargo.toml +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache/LICENSE +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache/src/config.rs +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache/src/entry.rs +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache/src/error.rs +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache/src/format.rs +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache/src/lib.rs +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache/src/policy.rs +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache/src/store.rs +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache/tests/blob_cache_integration.rs +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache-python/Cargo.toml +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache-python/LICENSE +0 -0
- {dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache-python/src/lib.rs +0 -0
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
# Legacy Materials remain under their original licenses.
|
|
9
9
|
# See LICENSE and LEGACY_NOTICES.md.
|
|
10
10
|
|
|
11
|
+
from dex._grpc_errors import RetryAfterError, retry_after
|
|
11
12
|
from dex.async_client import AsyncClient
|
|
12
13
|
from dex.async_worker import AsyncWorker
|
|
13
14
|
from dex.attribute import (
|
|
@@ -140,6 +141,7 @@ __all__ = [
|
|
|
140
141
|
"LongPollTimeoutError",
|
|
141
142
|
"PersistenceSchema",
|
|
142
143
|
"RPCResult",
|
|
144
|
+
"RetryAfterError",
|
|
143
145
|
"RpcLockConflictError",
|
|
144
146
|
"Registry",
|
|
145
147
|
"TimeTravelOptions",
|
|
@@ -184,4 +186,5 @@ __all__ = [
|
|
|
184
186
|
"go_to_many",
|
|
185
187
|
"open_blob_cache",
|
|
186
188
|
"rpc",
|
|
189
|
+
"retry_after",
|
|
187
190
|
]
|
|
@@ -37,7 +37,18 @@ _STACK_TRACE_TRUNCATION_MARKER = b"\n... stack trace truncated by Dex Python SDK
|
|
|
37
37
|
|
|
38
38
|
@dataclass(frozen=True)
|
|
39
39
|
class RetryAfterError(Exception):
|
|
40
|
-
"""Requests a delay before
|
|
40
|
+
"""Requests a delay before Dex retries a failed worker method.
|
|
41
|
+
|
|
42
|
+
Raise an instance with :func:`retry_after` from a Step method when the
|
|
43
|
+
failure is retryable but the next attempt should happen at a known time.
|
|
44
|
+
Dex reports the original cause as the worker failure and uses the requested
|
|
45
|
+
delay instead of the retry policy's calculated interval.
|
|
46
|
+
|
|
47
|
+
Attributes:
|
|
48
|
+
after_seconds (int): Positive delay in seconds before the next retry.
|
|
49
|
+
cause (BaseException): Original failure reported to Dex and re-raised
|
|
50
|
+
as the retry cause.
|
|
51
|
+
"""
|
|
41
52
|
|
|
42
53
|
after_seconds: int
|
|
43
54
|
cause: BaseException
|
|
@@ -47,6 +58,23 @@ class RetryAfterError(Exception):
|
|
|
47
58
|
|
|
48
59
|
|
|
49
60
|
def retry_after(after_seconds: int, cause: BaseException) -> RetryAfterError:
|
|
61
|
+
"""Creates an error that sets the delay before Dex retries a worker method.
|
|
62
|
+
|
|
63
|
+
Raise the returned error from a Step method after an external dependency
|
|
64
|
+
reports that it is not ready. For example::
|
|
65
|
+
|
|
66
|
+
raise retry_after(5, RuntimeError("service is not ready"))
|
|
67
|
+
|
|
68
|
+
Args:
|
|
69
|
+
after_seconds (int): Positive delay in seconds before the next retry.
|
|
70
|
+
cause (BaseException): Failure that Dex records as the worker error.
|
|
71
|
+
|
|
72
|
+
Returns:
|
|
73
|
+
RetryAfterError: Error to raise from the worker method.
|
|
74
|
+
|
|
75
|
+
Raises:
|
|
76
|
+
ValueError: If **after_seconds** is not positive or **cause** is None.
|
|
77
|
+
"""
|
|
50
78
|
if cause is None:
|
|
51
79
|
raise ValueError("cause is required")
|
|
52
80
|
if after_seconds <= 0:
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
{dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache-python/Cargo.toml
RENAMED
|
File without changes
|
|
File without changes
|
{dex_python_sdk-0.2.4 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache-python/src/lib.rs
RENAMED
|
File without changes
|