@@ -137,6 +137,9 @@ def pool_cleared(self, event):
137137 def pool_closed(self, event):
138138 logging.info("[pool {0.address}] pool closed".format(event))
139139
140+ def pool_backoff(self, event):
141+ logging.info("[pool {0.address}] pool backoff attempt {0.event}".format(event))
142+
140143 def connection_created(self, event):
141144 logging.info("[pool {0.address}][connection #{0.connection_id}] "
142145 "connection created".format(event))
@@ -305,6 +308,15 @@ def pool_closed(self, event: PoolClosedEvent) -> None:
305308 """
306309 raise NotImplementedError
307310
311+ def pool_backoff (self , event : PoolBackoffEvent ) -> None :
312+ """Abstract method to handle a `PoolBackoffEvent`.
313+
314+ Emitted when a connection Pool is in backoff.
315+
316+ :param event: An instance of :class:`PoolBackoffEvent`.
317+ """
318+ raise NotImplementedError
319+
308320 def connection_created (self , event : ConnectionCreatedEvent ) -> None :
309321 """Abstract method to handle a :class:`ConnectionCreatedEvent`.
310322
@@ -1852,12 +1864,12 @@ def publish_pool_closed(self, address: _Address) -> None:
18521864 except Exception :
18531865 _handle_exception ()
18541866
1855- def publish_pool_backoutt (self , address : _Address , attempt : int ) -> None :
1867+ def publish_pool_backoff (self , address : _Address , attempt : int ) -> None :
18561868 """Publish a :class:`PoolBackoffEvent` to all pool listeners."""
18571869 event = PoolBackoffEvent (address , attempt )
18581870 for subscriber in self .__cmap_listeners :
18591871 try :
1860- subscriber .pool_closed (event )
1872+ subscriber .pool_backoff (event )
18611873 except Exception :
18621874 _handle_exception ()
18631875
0 commit comments