Use early return instead of branching for remote emsd spawning
parent
fb996bfffb
commit
38471b7b34
|
@ -174,15 +174,13 @@ async def maybe_open_emsd(
|
|||
async with tractor.find_actor('emsd') as portal:
|
||||
if portal is not None:
|
||||
yield portal
|
||||
return
|
||||
|
||||
else:
|
||||
# ask remote daemon tree to spawn it
|
||||
from .._daemon import spawn_emsd
|
||||
|
||||
async with tractor.find_actor('pikerd') as portal:
|
||||
|
||||
if portal is not None:
|
||||
|
||||
assert portal
|
||||
name = await portal.run(
|
||||
spawn_emsd,
|
||||
brokername=brokername,
|
||||
|
@ -192,6 +190,7 @@ async def maybe_open_emsd(
|
|||
yield portal
|
||||
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
async def open_ems(
|
||||
broker: str,
|
||||
|
|
Loading…
Reference in New Issue