Skip to content

Commit 4e05dbf

Browse files
author
Andrei Neagu
committed
exposed all proxies
1 parent f03af79 commit 4e05dbf

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
from ._core import cancel_operation, start_operation
2-
from ._deferred_runner import get_step_group_proxy, get_step_store_proxy
2+
from ._deferred_runner import (
3+
get_opration_context_proxy,
4+
get_step_group_proxy,
5+
get_step_store_proxy,
6+
)
37
from ._lifespan import get_generic_scheduler_lifespans
48
from ._models import (
59
OperationName,
@@ -14,15 +18,17 @@
1418
ParallelStepGroup,
1519
SingleStepGroup,
1620
)
17-
from ._store import StepGroupProxy, StepStoreProxy
21+
from ._store import OperationContextProxy, StepGroupProxy, StepStoreProxy
1822

1923
__all__: tuple[str, ...] = (
2024
"BaseStep",
2125
"cancel_operation",
2226
"get_generic_scheduler_lifespans",
27+
"get_opration_context_proxy",
2328
"get_step_group_proxy",
2429
"get_step_store_proxy",
2530
"Operation",
31+
"OperationContextProxy",
2632
"OperationName",
2733
"OperationRegistry",
2834
"ParallelStepGroup",

services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_deferred_runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def get_step_group_proxy(context: DeferredContext) -> StepGroupProxy:
6565
)
6666

6767

68-
def _get_opration_context_proxy(context: DeferredContext) -> OperationContextProxy:
68+
def get_opration_context_proxy(context: DeferredContext) -> OperationContextProxy:
6969
app: FastAPI = context["app"]
7070
schedule_id: ScheduleId = context["schedule_id"]
7171
operation_name: OperationName = context["operation_name"]
@@ -174,7 +174,7 @@ async def run(cls, context: DeferredContext) -> None:
174174

175175
step = _get_step(context)
176176

177-
opration_context_proxy = _get_opration_context_proxy(context)
177+
opration_context_proxy = get_opration_context_proxy(context)
178178

179179
if is_creating:
180180
required_context = await opration_context_proxy.get_required_context(

services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_operation.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ def get_create_provides_context_keys(cls) -> set[str]:
6060
async def get_create_retries(cls, context: DeferredContext) -> int:
6161
"""
6262
[optional] amount of retires in case of creation
63-
HINT: you can use `get_step_group_proxy(context)` and `get_step_store_proxy(context)`
64-
to implement custom retry strategy
63+
HINT: you can use `get_opration_context_proxy()`, `get_step_group_proxy(context)`
64+
and `get_step_store_proxy(context)` to implement custom retry strategy
6565
"""
6666
assert context # nosec
6767
return _DEFAULT_STEP_RETRIES
@@ -72,8 +72,8 @@ async def get_create_wait_between_attempts(
7272
) -> timedelta:
7373
"""
7474
[optional] wait time between retires case of creation
75-
HINT: you can use `get_step_group_proxy(context)` and `get_step_store_proxy(context)`
76-
to implement custom retry strategy
75+
HINT: you can use `get_opration_context_proxy()`, `get_step_group_proxy(context)`
76+
and `get_step_store_proxy(context)` to implement custom retry strategy
7777
"""
7878
assert context # nosec
7979
return _DEFAULT_STEP_TIMEOUT
@@ -120,8 +120,8 @@ def get_revert_provides_context_keys(cls) -> set[str]:
120120
async def get_revert_retries(cls, context: DeferredContext) -> int:
121121
"""
122122
[optional] amount of retires in case of failure
123-
HINT: you can use `get_step_group_proxy(context)` and `get_step_store_proxy(context)`
124-
to implement custom retry strategy
123+
HINT: you can use `get_opration_context_proxy()`, `get_step_group_proxy(context)`
124+
and `get_step_store_proxy(context)` to implement custom retry strategy
125125
"""
126126
assert context # nosec
127127
return _DEFAULT_STEP_RETRIES
@@ -132,8 +132,8 @@ async def get_revert_wait_between_attempts(
132132
) -> timedelta:
133133
"""
134134
[optional] timeout between retires in case of failure
135-
HINT: you can use `get_step_group_proxy(context)` and `get_step_store_proxy(context)`
136-
to implement custom retry strategy
135+
HINT: you can use `get_opration_context_proxy()`, `get_step_group_proxy(context)`
136+
and `get_step_store_proxy(context)` to implement custom retry strategy
137137
"""
138138
assert context # nosec
139139
return _DEFAULT_STEP_TIMEOUT

0 commit comments

Comments
 (0)