forked from goodboy/tractor
Cancel remote async gens when `aclose()` is called
parent
4dccb44c67
commit
32c7a06e6a
|
@ -139,7 +139,9 @@ class Portal:
|
||||||
"Received internal error at portal?")
|
"Received internal error at portal?")
|
||||||
raise unpack_error(msg, self.channel)
|
raise unpack_error(msg, self.channel)
|
||||||
|
|
||||||
except StopAsyncIteration:
|
except GeneratorExit:
|
||||||
|
# for now this msg cancels an ongoing remote task
|
||||||
|
await self.channel.send({'cancel': True, 'cid': cid})
|
||||||
log.debug(
|
log.debug(
|
||||||
f"Cancelling async gen call {cid} to "
|
f"Cancelling async gen call {cid} to "
|
||||||
f"{self.channel.uid}")
|
f"{self.channel.uid}")
|
||||||
|
|
Loading…
Reference in New Issue