Some minor doc/comment tweaks
parent
aa32f42715
commit
2ce8e06619
|
@ -104,7 +104,7 @@ def run_daemon(
|
||||||
|
|
||||||
This is a convenience wrapper around
|
This is a convenience wrapper around
|
||||||
``tractor.run(trio.sleep(float('inf')))`` such that the first actor spawned
|
``tractor.run(trio.sleep(float('inf')))`` such that the first actor spawned
|
||||||
is meant to run forever handling to RPC requests.
|
is meant to run forever responding to RPC requests.
|
||||||
"""
|
"""
|
||||||
kwargs['rpc_module_paths'] = rpc_module_paths
|
kwargs['rpc_module_paths'] = rpc_module_paths
|
||||||
|
|
||||||
|
|
|
@ -218,6 +218,7 @@ class Actor:
|
||||||
# - has to do with await main() in MainProcess)
|
# - has to do with await main() in MainProcess)
|
||||||
# if self.name == 'gretchen':
|
# if self.name == 'gretchen':
|
||||||
# self._mods.pop('test_discovery')
|
# self._mods.pop('test_discovery')
|
||||||
|
# TODO: how to test the above?
|
||||||
|
|
||||||
async def _stream_handler(
|
async def _stream_handler(
|
||||||
self,
|
self,
|
||||||
|
@ -399,8 +400,8 @@ class Actor:
|
||||||
forkserver_info: Tuple[Any, Any, Any, Any, Any],
|
forkserver_info: Tuple[Any, Any, Any, Any, Any],
|
||||||
parent_addr: Tuple[str, int] = None
|
parent_addr: Tuple[str, int] = None
|
||||||
) -> None:
|
) -> None:
|
||||||
# after fork routine which invokes a fresh ``trio.run``
|
"""The routine called *after fork* which invokes a fresh ``trio.run``
|
||||||
# log.warning("Log level after fork is {self.loglevel}")
|
"""
|
||||||
self._forkserver_info = forkserver_info
|
self._forkserver_info = forkserver_info
|
||||||
from ._trionics import ctx
|
from ._trionics import ctx
|
||||||
if self.loglevel is not None:
|
if self.loglevel is not None:
|
||||||
|
@ -447,7 +448,7 @@ class Actor:
|
||||||
if parent_addr is not None:
|
if parent_addr is not None:
|
||||||
try:
|
try:
|
||||||
# Connect back to the parent actor and conduct initial
|
# Connect back to the parent actor and conduct initial
|
||||||
# handshake (From this point on if we error ship the
|
# handshake (From this point on if we error, ship the
|
||||||
# exception back to the parent actor)
|
# exception back to the parent actor)
|
||||||
chan = self._parent_chan = Channel(
|
chan = self._parent_chan = Channel(
|
||||||
destaddr=parent_addr,
|
destaddr=parent_addr,
|
||||||
|
@ -476,14 +477,13 @@ class Actor:
|
||||||
|
|
||||||
task_status.started()
|
task_status.started()
|
||||||
log.debug("Waiting on root nursery to complete")
|
log.debug("Waiting on root nursery to complete")
|
||||||
# blocks here as expected if no nursery was provided until
|
|
||||||
# the channel server is killed (i.e. this actor is
|
# blocks here as expected until the channel server is
|
||||||
# cancelled or signalled by the parent actor)
|
# killed (i.e. this actor is cancelled or signalled by the parent)
|
||||||
except Exception:
|
except Exception:
|
||||||
if self._parent_chan:
|
if self._parent_chan:
|
||||||
try:
|
try:
|
||||||
await self._parent_chan.send(
|
await self._parent_chan.send(
|
||||||
# {'error': traceback.format_exc(), 'cid': 'internal'})
|
|
||||||
{'error': traceback.format_exc()})
|
{'error': traceback.format_exc()})
|
||||||
except trio.ClosedResourceError:
|
except trio.ClosedResourceError:
|
||||||
log.error(
|
log.error(
|
||||||
|
|
Loading…
Reference in New Issue