Skip to content

Commit 7d5cae6

Browse files
authored
Merge pull request #24 from dfseifert/main
fix: correct typo in function name and add compatibility alias
2 parents 1e0cd04 + 923de84 commit 7d5cae6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/pyper/_core/async_helper/output.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from typing import TYPE_CHECKING
77

88
from .stage import AsyncProducer, AsyncProducerConsumer
9-
from ..util.asynchronize import ascynchronize
9+
from ..util.asynchronize import asynchronize
1010
from ..util.sentinel import StopSentinel
1111

1212
if sys.version_info < (3, 11): # pragma: no cover
@@ -26,7 +26,7 @@ def _get_q_out(self, tg: TaskGroup, tp: ThreadPoolExecutor, pp: ProcessPoolExecu
2626
"""Feed forward each stage to the next, returning the output queue of the final stage."""
2727
q_out = None
2828
for task, next_task in zip(self.pipeline.tasks, self.pipeline.tasks[1:] + [None]):
29-
task = ascynchronize(task, tp=tp, pp=pp)
29+
task = asynchronize(task, tp=tp, pp=pp)
3030
if q_out is None:
3131
stage = AsyncProducer(task=task, next_task=next_task)
3232
stage.start(tg, *args, **kwargs)

src/pyper/_core/util/asynchronize.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from ..task import Task
88

99

10-
def ascynchronize(task: Task, tp: ThreadPoolExecutor, pp: ProcessPoolExecutor) -> Task:
10+
def asynchronize(task: Task, tp: ThreadPoolExecutor, pp: ProcessPoolExecutor) -> Task:
1111
"""Unify async and sync tasks as awaitable futures.
1212
1. If the task is async already, return it.
1313
2. Multiprocessed synchronous functions are wrapped in a call to `run_in_executor` using `ProcessPoolExecutor`.
@@ -36,3 +36,7 @@ async def wrapper(*args, **kwargs):
3636
workers=task.workers,
3737
throttle=task.throttle
3838
)
39+
40+
41+
# backwards compatibility
42+
ascynchronize = asynchronize

0 commit comments

Comments
 (0)