Skip to content

Latest commit

 

History

History
41 lines (34 loc) · 1.02 KB

File metadata and controls

41 lines (34 loc) · 1.02 KB

Connection Pool

A simple general concurrency singleton connection pool.

support redis and mysql

redis

based on hiredis

mysql

dependence

necessary

usage

find_package(connection_pool 1.0.0 QUIET)
if (NOT connection_pool_FOUND)
    include(FetchContent)
    fetchcontent_declare(connection_pool
        GIT_REPOSITORY https://github.com/Portgas-D-Asce/ConnectionPool.git
        GIT_TAG v1.0.0-alpha
    )
    fetchcontent_makeavailable(connection_pool)
    # 拉取失败
    if(NOT connection_pool_POPULATED)
        message(FATAL_ERROR "fetch connection_pool failed!")
    endif ()
endif ()

target_link_libraries(exec
    PUBLIC
    $<$<BOOL:${connection_pool_FOUND}>:connection_pool::>redis_pool
    # $<$<BOOL:${connection_pool_FOUND}>:connection_pool::>mysql_pool
)