Port pikerd entry to drop `tractor.run()`
parent
79d37646a2
commit
7ca05238af
|
@ -4,6 +4,7 @@ CLI commons.
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import click
|
import click
|
||||||
|
import trio
|
||||||
import tractor
|
import tractor
|
||||||
|
|
||||||
from ..log import get_console_log, get_logger, colorize_json
|
from ..log import get_console_log, get_logger, colorize_json
|
||||||
|
@ -35,13 +36,14 @@ _context_defaults = dict(
|
||||||
def pikerd(loglevel, host, tl):
|
def pikerd(loglevel, host, tl):
|
||||||
"""Spawn the piker broker-daemon.
|
"""Spawn the piker broker-daemon.
|
||||||
"""
|
"""
|
||||||
from .._daemon import _data_mods
|
from .._daemon import _data_mods, open_pikerd
|
||||||
get_console_log(loglevel)
|
get_console_log(loglevel)
|
||||||
tractor.run_daemon(
|
|
||||||
rpc_module_paths=_data_mods,
|
async def main():
|
||||||
name='brokerd',
|
async with open_pikerd(loglevel):
|
||||||
loglevel=loglevel if tl else None,
|
await trio.sleep_forever()
|
||||||
)
|
|
||||||
|
trio.run(main)
|
||||||
|
|
||||||
|
|
||||||
@click.group(context_settings=_context_defaults)
|
@click.group(context_settings=_context_defaults)
|
||||||
|
|
Loading…
Reference in New Issue