def __ensure_not_closing(self): if self._closing: raise Unavailable('Closing')
def __ensure_not_closed(self): if self._closed: raise Unavailable('Closed')
def __ensure_need_reconnect(self): self.__ensure_not_closed() if not self._need_reconnect: raise Unavailable('Give up reconnect')