Skip to content

Commit 67aa1f4

Browse files
add note about combination with parallelize
1 parent 241b541 commit 67aa1f4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

rosys/automation/automation.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212

1313

1414
def uninterruptible(func: Callable):
15-
"""Decorator to make an async function uninterruptible until it exits."""
15+
"""Decorator to make an async function uninterruptible until it exits.
16+
17+
Note that ``rosys.automation.parallelize`` will also be uninterruptible if one of its coroutines is marked with this decorator.
18+
"""
1619
@functools.wraps(func)
1720
async def _wrapped(*args, **kwargs):
1821
automation = _CURRENT_AUTOMATION.get()

rosys/automation/parallelize.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ class parallelize:
88
This class allows to combine multiple coroutines into one that can be passed to the
99
`automator <https://rosys.io/reference/rosys/automation/#rosys.automation.Automator>`__
1010
to run them in parallel.
11+
12+
Note that ``parallelize`` will be uninterruptible if one of its coroutines is marked with ``@rosys.automation.uninterruptible``.
1113
"""
1214

1315
def __init__(self, *coros: Coroutine, return_when_first_completed: bool = False) -> None:

0 commit comments

Comments
 (0)