| 782 | self.ntxns = 0 |
| 783 | |
| 784 | def ready(self) -> None: |
| 785 | # Take the lock to avoid the race condition described in PYTHON-2699. |
| 786 | with self.lock: |
| 787 | if self.state != PoolState.READY: |
| 788 | self.state = PoolState.READY |
| 789 | if self.enabled_for_cmap: |
| 790 | assert self.opts._event_listeners is not None |
| 791 | self.opts._event_listeners.publish_pool_ready(self.address) |
| 792 | if self.enabled_for_logging and _CONNECTION_LOGGER.isEnabledFor(logging.DEBUG): |
| 793 | _debug_log( |
| 794 | _CONNECTION_LOGGER, |
| 795 | message=_ConnectionStatusMessage.POOL_READY, |
| 796 | clientId=self._client_id, |
| 797 | serverHost=self.address[0], |
| 798 | serverPort=self.address[1], |
| 799 | ) |
| 800 | |
| 801 | @property |
| 802 | def closed(self) -> bool: |