Async - backend development framework in C++ using io_uring event-loop.
=====
Async is a set of c++ primitives that allows you efficient and rapid development in c++17 on linux systems. The focus is mostly for backend development, data processing etc.
- Dependency on abseil-cpp
- Dependency on Boost 1.71
- Uses ninja-build on top of cmake
- Build artifacts are docker-friendly.
- HTTP server implementation.
- Many other features.
I will gradually add explanations for most crucial blocks in this library.
Setting Up & Building
> sudo ./install-dependencies.sh
> ./blaze.sh -ninja -release
> cd build-opt && ninja -j4 echo_server
third_party folder is checked out under build directories.
Then, from 2 tabs run:
server> ./echo_server --logtostderr
client> ./echo_server --connect=localhost --n 100000 --c=4
HTTP
HTTP handler is implemented using Boost.Beast library. It's integrated with the io_uring based ProactorPool.
Please see http_main.cc, for example. HTTP also provides support for backend monitoring (Varz status page) and for extensible debugging interface. With monitoring C++ backend returns json object that is formatted inside status page in the browser. To check how it looks, please go to localhost:8080 while echo_server
is running.
Self-profiling
Every http-powered backend has integrated CPU profiling capabilities using gperf-tools and pprof Profiling can be trigerred in prod using magic-url commands. Enabled profiling usually has very minimal impact on cpu performance of the running backend.
Logging
Logging is based on Google's glog library. The library is very reliable, performant and solid. It has many features that allow resilient backend development. Unfortunately, Google's version has some bugs, which I fixed (waiting for review...), so I use my own fork. Glog library gives me the ability to control logging levels of a backend at run-time without restarting it.
Tests
ASYNC uses googletest+gmock unit-test environment.
Conventions
Third_party packages have TRDP::
prefix in CMakeLists.txt
. absl libraries have prefix
absl::...
.