Skip to content

paveltrpn/poller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

141 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Poller

A C++20 HTTP client library built with coroutines, featuring async/await support and event-driven architecture.

About

Poller is a simple HTTP client library leveraging C++20 coroutines and the libuv event loop for efficient asynchronous I/O operations. The library provides a clean, modern interface for making HTTP requests with support for both non-blocking and blocking awaitable patterns.

Building Dependencies

All dependencies are available as source code and should be built manually:

libcurl:

$ apt install libpsl-dev
$ git clone https://github.com/curl/curl
$ mkdir build && cd build
$ cmake .. 
$ cmake --build . --parallel {N}
$ cmake --install . --prefix=/{some}/{path}

libuv:

$ git clone https://github.com/libuv/libuv
$ cd libuv
$ mkdir build && cd build
$ cmake .. 
$ cmake --build . --parallel {N}
$ cmake --install . --prefix=/{some}/{path}

nlohmann-json:

$ cd {some}/{path}
$ git clone https://github.com/nlohmann/json

Build

Requirements

  • Compiler with C++26 support (clang++ recommended)
  • CMake 4.2 or higher

Configuration

Set environment variables pointing to your dependency installations:

export LIBCURL_DIR={some}/{path}/curl
export LIBUV_DIR={some}/{path}/libuv
export NLOHMANN_JSON_DIR={some}/{path}/json

Compilation

$ mkdir build
$ cd build
$ cmake ..
$ cmake --build .

Compiler Configuration

By default, the project uses clang++ with libc++ for better C++26 support. You can override:

$ cmake .. -DCMAKE_CXX_FLAGS=-stdlib=libstdc++ -DCMAKE_CXX_COMPILER=$(which g++)
$ cmake .. -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DCMAKE_CXX_COMPILER=$(which clang++)

Build type can be changed via -DCMAKE_BUILD_TYPE:

$ cmake .. -DCMAKE_BUILD_TYPE=Release

About

HTTP request library. CURL wrapper. Small abuse of C++20 coroutines.

Topics

Resources

Stars

Watchers

Forks

Contributors