forked from goodboy/tractor
Lul, fix everything for cluster helper
parent
3f8f848ce8
commit
38b844fb22
|
@ -17,7 +17,10 @@ async def open_actor_cluster(
|
||||||
count: int = cpu_count(),
|
count: int = cpu_count(),
|
||||||
names: Optional[list[str]] = None,
|
names: Optional[list[str]] = None,
|
||||||
|
|
||||||
) -> AsyncGenerator[..., dict[str, tractor.Portal]]:
|
) -> AsyncGenerator[
|
||||||
|
list[str],
|
||||||
|
dict[str, tractor.Portal]
|
||||||
|
]:
|
||||||
|
|
||||||
portals: dict[str, tractor.Portal] = {}
|
portals: dict[str, tractor.Portal] = {}
|
||||||
uid = tractor.current_actor().uid
|
uid = tractor.current_actor().uid
|
||||||
|
@ -30,10 +33,8 @@ async def open_actor_cluster(
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
'Number of names is {len(names)} but count it {count}')
|
'Number of names is {len(names)} but count it {count}')
|
||||||
|
|
||||||
async with (
|
async with tractor.open_nursery() as an:
|
||||||
tractor.open_nursery() as an,
|
async with trio.open_nursery() as n:
|
||||||
trio.open_nursery() as n,
|
|
||||||
):
|
|
||||||
for index, key in zip(range(count), names):
|
for index, key in zip(range(count), names):
|
||||||
|
|
||||||
async def start(i) -> None:
|
async def start(i) -> None:
|
||||||
|
|
Loading…
Reference in New Issue