(self)
Cancel the task.

        Set the `cancelled` field to True and block until the future is done.
Cancel the task.
Cancel the task .
def cancel(self):
        """
        Cancel the task.

        Set the `cancelled` field to True and block until the future is done.
        """
        # set cancelled state
        self.cancelled = True
        self.future.cancel()
        concurrent.futures.wait([self.future])
def cancel ( self ) : # set cancelled state self . cancelled = True self . future . cancel ( ) concurrent . futures . wait ( [ self . future ] )