You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
This is somewhat implemented with our new ContextCancelled style signalling in the Portal.open_context() api.
Work in https://github.com/goodboy/tractor/tree/zombie_lord_infinite also starts trying to apply the task-contexts stuff to regular rpc calls, and eventually we should probably implement all invocation apis this way (Portal.run(), Portal.open_stream_from()). I've actually been thinking we could also return a cancel scope like object from some of these calls:
asyncwithtractor.open_nursery() asn:
portal, context=awaitn.run_in_actor(blah)
# stuff# this waits on the top level task for a resultawaitcontext.result()
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 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 withtractor
systems using this same protocol.The text was updated successfully, but these errors were encountered: