def METHOD_NAME(self, exc):
    self._closed = True
    if self._resp_waiters:
        if exc is not None:
            for waiter in self._resp_waiters.values():
                waiter.set_exception(exc)
        else:
            for waiter in self._resp_waiters.values():
                waiter.set_exception(ConnectionError(
                    'lost connection to the worker during a call'))
        self._resp_waiters = {}
    self._on_connection_lost(self._pid)