Make standalone mode work again
parent
feeabb3d28
commit
0b10c8d6d6
|
@ -54,6 +54,7 @@ _services: Optional[Services] = None
|
||||||
|
|
||||||
@asynccontextmanager
|
@asynccontextmanager
|
||||||
async def open_pikerd(
|
async def open_pikerd(
|
||||||
|
start_method: str = 'trio',
|
||||||
loglevel: Optional[str] = None,
|
loglevel: Optional[str] = None,
|
||||||
|
|
||||||
# XXX: you should pretty much never want debug mode
|
# XXX: you should pretty much never want debug mode
|
||||||
|
@ -78,6 +79,7 @@ async def open_pikerd(
|
||||||
name=_root_dname,
|
name=_root_dname,
|
||||||
loglevel=loglevel,
|
loglevel=loglevel,
|
||||||
debug_mode=debug_mode,
|
debug_mode=debug_mode,
|
||||||
|
start_method=start_method,
|
||||||
|
|
||||||
# TODO: eventually we should be able to avoid
|
# TODO: eventually we should be able to avoid
|
||||||
# having the root have more then permissions to
|
# having the root have more then permissions to
|
||||||
|
@ -137,8 +139,7 @@ async def maybe_open_pikerd(
|
||||||
|
|
||||||
# presume pikerd role
|
# presume pikerd role
|
||||||
async with open_pikerd(
|
async with open_pikerd(
|
||||||
loglevel,
|
loglevel=loglevel,
|
||||||
**kwargs,
|
|
||||||
) as _:
|
) as _:
|
||||||
# in the case where we're starting up the
|
# in the case where we're starting up the
|
||||||
# tractor-piker runtime stack in **this** process
|
# tractor-piker runtime stack in **this** process
|
||||||
|
|
|
@ -200,7 +200,6 @@ def run_qtractor(
|
||||||
async def main():
|
async def main():
|
||||||
|
|
||||||
async with maybe_open_pikerd(
|
async with maybe_open_pikerd(
|
||||||
start_method='trio',
|
|
||||||
**tractor_kwargs,
|
**tractor_kwargs,
|
||||||
):
|
):
|
||||||
await func(*((widgets,) + args))
|
await func(*((widgets,) + args))
|
||||||
|
|
Loading…
Reference in New Issue