A simple general concurrency singleton connection pool.
support redis and mysql
based on hiredis
necessary
- hiredis
- tomlplusplus
- spdlog optional
- googletest
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
)