class_docstr: Available events for :class:`_pool.Pool`.
  
  The methods here define the name of an event as well
  as the names of members that are passed to listener
  functions.
  
  e.g.::
  
      from sqlalchemy import event
  
      def my_on_checkout(dbapi_conn, connection_rec, connection_proxy):
          "handle an on checkout event"
  
      event.listen(Pool, 'checkout', my_on_checkout)
  
  In addition to accepting the :class:`_pool.Pool` class and
  :class:`_pool.Pool` instances, :class:`_events.PoolEvents` also accepts
  :class:`_engine.Engine` objects and the :class:`_engine.Engine` class as
  targets, which will be resolved to the ``.pool`` attribute of the
  given engine or the :class:`_pool.Pool` class::
  
      engine = create_engine("postgresql+psycopg2://scott:tiger@localhost/test")
  
      # will associate with engine.pool
      event.listen(engine, 'checkout', my_on_checkout)
class_docstr_tok: ["Available","events","for",":","class",":","`","_pool.Pool","`",".","The","methods","here","define","the","name","of","an","event","as","well","as","the","names","of","members","that","are","passed","to","listener","functions",".","e.g",".",":",":","from","sqlalchemy","import","event","def","my_on_checkout","(","dbapi_conn",",","connection_rec",",","connection_proxy",")",":","``","handle","an","on","checkout","event","''","event.listen","(","Pool",",","'checkout","'",",","my_on_checkout",")","In","addition","to","accepting","the",":","class",":","`","_pool.Pool","`","class","and",":","class",":","`","_pool.Pool","`","instances",",",":","class",":","`","_events.PoolEvents","`","also","accepts",":","class",":","`","_engine.Engine","`","objects","and","the",":","class",":","`","_engine.Engine","`","class","as","targets",",","which","will","be","resolved","to","the","``",".pool","``","attribute","of","the","given","engine","or","the",":","class",":","`","_pool.Pool","`","class",":",":","engine","=","create_engine","(","``","postgresql+psycopg2",":","\/\/scott",":","tiger","@","localhost\/test","''",")","#","will","associate","with","engine.pool","event.listen","(","engine",",","'checkout","'",",","my_on_checkout",")"]
docstr: Called when a DBAPI connection is to be "soft invalidated".
  
  This event is called any time the
  :meth:`.ConnectionPoolEntry.invalidate`
  method is invoked with the ``soft`` flag.
  
  Soft invalidation refers to when the connection record that tracks
  this connection will force a reconnect after the current connection
  is checked in.   It does not actively close the dbapi_connection
  at the point at which it is called.
  
  :param dbapi_connection: a DBAPI connection.
   The :attr:`.ConnectionPoolEntry.dbapi_connection` attribute.
  
  :param connection_record: the :class:`.ConnectionPoolEntry` managing
   the DBAPI connection.
  
  :param exception: the exception object corresponding to the reason
   for this invalidation, if any.  May be ``None``.
docstr_tok: ["Called","when","a","DBAPI","connection","is","to","be","``","soft","invalidated","''",".","This","event","is","called","any","time","the",":","meth",":","`",".ConnectionPoolEntry.invalidate","`","method","is","invoked","with","the","``","soft","``","flag",".","Soft","invalidation","refers","to","when","the","connection","record","that","tracks","this","connection","will","force","a","reconnect","after","the","current","connection","is","checked","in",".","It","does","not","actively","close","the","dbapi_connection","at","the","point","at","which","it","is","called",".",":","param","dbapi_connection",":","a","DBAPI","connection",".","The",":","attr",":","`",".ConnectionPoolEntry.dbapi_connection","`","attribute",".",":","param","connection_record",":","the",":","class",":","`",".ConnectionPoolEntry","`","managing","the","DBAPI","connection",".",":","param","exception",":","the","exception","object","corresponding","to","the","reason","for","this","invalidation",",","if","any",".","May","be","``","None","``","."]
code: def soft_invalidate(
      self,
      dbapi_connection: DBAPIConnection,
      connection_record: ConnectionPoolEntry,
      exception: Optional[BaseException],
  ) -> None:
      """Called when a DBAPI connection is to be "soft invalidated".
  
      This event is called any time the
      :meth:`.ConnectionPoolEntry.invalidate`
      method is invoked with the ``soft`` flag.
  
      Soft invalidation refers to when the connection record that tracks
      this connection will force a reconnect after the current connection
      is checked in.   It does not actively close the dbapi_connection
      at the point at which it is called.
  
      :param dbapi_connection: a DBAPI connection.
       The :attr:`.ConnectionPoolEntry.dbapi_connection` attribute.
  
      :param connection_record: the :class:`.ConnectionPoolEntry` managing
       the DBAPI connection.
  
      :param exception: the exception object corresponding to the reason
       for this invalidation, if any.  May be ``None``.
  
      """
  
imports: from __future__ import annotations
  import typing
  from typing import Any
  from typing import Optional
  from typing import Type
  from typing import Union
  from .base import ConnectionPoolEntry
  from .base import Pool
  from .base import PoolProxiedConnection
  from .base import PoolResetState
  from ..None import event
  from ..None import util
label_desc: Use image node_id 9 for calling the PoolEvents obj's underlying member method code with example usage: obj.soft_invalidate(dbapi_connection, connection_record, exception) without return types