class ActiveRecord::ConnectionAdapters::ConnectionHandler

def retrieve_connection_pool(owner, role: ActiveRecord::Base.current_role, shard: ActiveRecord::Base.current_shard)

Experimental RBS support (using type sampling data from the type_fusion project).

def retrieve_connection_pool: (String owner, role: Symbol, shard: Symbol) -> ActiveRecord::ConnectionAdapters::ConnectionPool

This signature was generated using 88 samples from 2 applications.

When a connection is established or removed, we invalidate the cache.
This makes retrieving the connection pool O(1) once the process is warm.
Retrieving the connection pool happens a lot, so we cache it in @owner_to_pool_manager.
def retrieve_connection_pool(owner, role: ActiveRecord::Base.current_role, shard: ActiveRecord::Base.current_shard)
  pool_config = get_pool_manager(owner)&.get_pool_config(role, shard)
  pool_config&.pool
end