forked from goodboy/tractor
Log on KBI cancelled termination
parent
a24c6bfdd2
commit
ae9016c06a
|
@ -23,6 +23,7 @@ async def get_arbiter(
|
|||
arbiter.
|
||||
"""
|
||||
actor = current_actor()
|
||||
|
||||
if not actor:
|
||||
raise RuntimeError("No actor instance has been defined yet?")
|
||||
|
||||
|
@ -38,7 +39,8 @@ async def get_arbiter(
|
|||
|
||||
@asynccontextmanager
|
||||
async def find_actor(
|
||||
name: str, arbiter_sockaddr: Tuple[str, int] = None
|
||||
name: str,
|
||||
arbiter_sockaddr: Tuple[str, int] = None
|
||||
) -> typing.AsyncGenerator[Optional[Portal], None]:
|
||||
"""Ask the arbiter to find actor(s) by name.
|
||||
|
||||
|
|
|
@ -72,8 +72,10 @@ def _trio_main(
|
|||
actor._async_main,
|
||||
parent_addr=parent_addr
|
||||
)
|
||||
|
||||
try:
|
||||
trio.run(trio_main)
|
||||
except KeyboardInterrupt:
|
||||
pass # handle it the same way trio does?
|
||||
log.info(f"Actor {actor.uid} terminated")
|
||||
log.warning(f"Actor {actor.uid} received KBI")
|
||||
|
||||
log.info(f"Actor {actor.uid} terminated")
|
||||
|
|
Loading…
Reference in New Issue