I wrote a callback function using twisted Now my question is when websocket connection dropped I need to stop this callback.
def sendBack(self, payload):
# find correct way to identify connection dropped now using wasnotcl...
# stop this callback
reactor.callLater(delay, self.sendBack, payload=payload)
callID = reactor.callLater(delay, self.sendBack, payload=payload) if self.wasNotCleanReason: callID.cancel()