Use shorthand nursery var-names per convention in codebase

hilevel_serman
Tyler Goodlet 2024-12-11 20:26:13 -05:00
parent 840c328f19
commit 170e198683
1 changed files with 10 additions and 14 deletions

View File

@ -160,8 +160,8 @@ async def open_service_mngr(
): ):
# impl specific obvi.. # impl specific obvi..
init_kwargs.update({ init_kwargs.update({
'actor_n': an, 'an': an,
'service_n': tn, 'tn': tn,
}) })
mngr: ServiceMngr|None mngr: ServiceMngr|None
@ -174,15 +174,11 @@ async def open_service_mngr(
# eventual `@singleton_acm` API wrapper. # eventual `@singleton_acm` API wrapper.
# #
# assign globally for future daemon/task creation # assign globally for future daemon/task creation
mngr.actor_n = an mngr.an = an
mngr.service_n = tn mngr.tn = tn
else: else:
assert ( assert (mngr.an and mngr.tn)
mngr.actor_n
and
mngr.service_tn
)
log.info( log.info(
'Using extant service mngr!\n\n' 'Using extant service mngr!\n\n'
f'{mngr!r}\n' # it has a nice `.__repr__()` of services state f'{mngr!r}\n' # it has a nice `.__repr__()` of services state
@ -349,8 +345,8 @@ class ServiceMngr:
process tree. process tree.
''' '''
actor_n: ActorNursery an: ActorNursery
service_n: trio.Nursery tn: trio.Nursery
debug_mode: bool = False # tractor sub-actor debug mode flag debug_mode: bool = False # tractor sub-actor debug mode flag
service_tasks: dict[ service_tasks: dict[
@ -423,7 +419,7 @@ class ServiceMngr:
( (
cs, cs,
complete, complete,
) = await self.service_n.start(_task_manager_start) ) = await self.tn.start(_task_manager_start)
# store the cancel scope and portal for later cancellation or # store the cancel scope and portal for later cancellation or
# retstart if needed. # retstart if needed.
@ -485,7 +481,7 @@ class ServiceMngr:
for details. for details.
''' '''
cs, ipc_ctx, complete, started = await self.service_n.start( cs, ipc_ctx, complete, started = await self.tn.start(
functools.partial( functools.partial(
_open_and_supervise_service_ctx, _open_and_supervise_service_ctx,
serman=self, serman=self,
@ -542,7 +538,7 @@ class ServiceMngr:
return sub_ctx return sub_ctx
if daemon_name not in self.service_ctxs: if daemon_name not in self.service_ctxs:
portal: Portal = await self.actor_n.start_actor( portal: Portal = await self.an.start_actor(
daemon_name, daemon_name,
debug_mode=( # maybe set globally during allocate debug_mode=( # maybe set globally during allocate
debug_mode debug_mode