I was just trying to psuedo complete #36 for a collaborator and realized we don't have a way to cancel a task arbitrarily started from the calling actor.
This should be possible in theory by creating our own version of trio.CancelScope that is aware of tasks started by Portal.run(). I don't think anything more is needed other then that since ActorNursery.run_in_actor() main tasks should in theory be solo and cancelled when the actor terminates (which happens when the nursery exits).
One question is whether we should add a new 'cancel' message to the in-progress iac protocol.
Right now you can use the existing "rpc" mechanisms to call a cancel method on the remote Actor (specifically ._cancle_task()), but this is likely too tightly coupled to tractor's specific implementation in the case where we want to support other languages which can interact in an SC way with tractor systems using this same protocol.
I was just trying to psuedo complete #36 for a collaborator and realized we don't have a way to cancel a task arbitrarily started from the calling actor.
This should be possible in theory by creating our own version of
trio.CancelScopethat is aware of tasks started byPortal.run(). I don't think anything more is needed other then that sinceActorNursery.run_in_actor()main tasks should in theory be solo and cancelled when the actor terminates (which happens when the nursery exits).One question is whether we should add a new
'cancel'message to the in-progress iac protocol.Right now you can use the existing "rpc" mechanisms to call a cancel method on the remote
Actor(specifically._cancle_task()), but this is likely too tightly coupled totractor's specific implementation in the case where we want to support other languages which can interact in an SC way withtractorsystems using this same protocol.