def _cancelCommands(self, reason):
        """
        Cancel all the outstanding commands, making them fail with C{reason}.
        """
        while self._current:
            cmd = self._current.popleft()
            cmd.fail(reason)

        Cancel all the outstanding commands, making them fail with C{reason}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/protocols/memcache.py