[Twisted-Python] Cancelling a pb callRemote

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Wed Sep 18 06:34:26 MDT 2013


On 12:03 pm, p.mayers at imperial.ac.uk wrote:
>Is there any support, or any interest in / way to add support for 
>deferred cancellation in pb?
>
>Specifically I'd like do have something like:
>
>class blah(pb...):
>   def remote_somelongtask(self, args):
>     ...
>     taskid = somefunc()
>     d = defer.Deferred(lambda : canceltask(taskid))
>     return d
>
>...and on the client:
>
>d = callRemote('somelongtask', args)
>...
># now we no longer need it
>d.cancel()
>
>...and have the cancel the server-side task.

s/task/Deferred/ :)

+1 - particularly if you also want to tackle this for AMP.

Jean-Paul




More information about the Twisted-Python mailing list