# This file was generated by stubgen-pyx v0.2.18 from /Users/long2ice/Developer/long2ice/asyncmy/asyncmy/pool.pyx
from typing import Any
from typing_extensions import Self
from asyncmy.contexts import _PoolAcquireContextManager, _PoolContextManager

from asyncmy.connection import Connection

class Pool:
    """Connection pool, just from aiomysql"""
    def __init__(
        self, minsize: int, maxsize: int, pool_recycle: int = 3600, echo: bool = False, **kwargs
    ): ...
    @property
    def echo(self): ...
    @property
    def cond(self): ...
    @property
    def minsize(self): ...
    @property
    def maxsize(self): ...
    @property
    def size(self): ...
    @property
    def freesize(self): ...
    async def clear(self) -> None:
        """Close all free connections in pool."""
    def close(self) -> None:
        """Close pool.

        Mark all pool connections to be closed on getting back to pool.
        Closed pool doesn't allow one to acquire new connections.
        """
    def terminate(self) -> None:
        """Terminate pool.

        Close pool with instantly closing all acquired connections also.
        """
    async def wait_closed(self) -> None:
        """Wait for closing all pool's connections."""
    def acquire(self) -> _PoolAcquireContextManager[Connection]:
        """Acquire free connection from the pool."""
    async def fill_free_pool(self, override_min: bool = False): ...
    def release(self, conn: Connection) -> Any:
        """
        Release free connection back to the connection pool.

        This is **NOT** a coroutine.
        """
    async def __aenter__(self) -> Self: ...
    async def __aexit__(self, exc_type, exc_val, exc_tb): ...

def create_pool(
    minsize: int = 1, maxsize: int = 10, echo=False, pool_recycle: int = 3600, **kwargs
) -> _PoolContextManager[Pool]: ...
