I have a Twisted client/server application where a client asks multiple servers for additional work to be done using AMP. The first server to respond to the client wins -- the other outstanding client requests should be cancelled.
Deferred
objects support cancel()
and a cancellor function may be passed to the Deferred
's constructor. However, AMP's sendRemote()
api doesn't support passing a cancellor function. Additionally, I'd want the cancellor function to not only stop the local request from processing upon completion but also remove the request from the remote server.
AMP's BoxDispatcher
does have a stopReceivingBoxes
method, but that causes all deferreds to error out (not quite what I want).
Is there a way to cancel AMP requests?