Vitex is a cross-platform C++17/20/23 framework targeted for sync/async/promise client/server development. Applications developed with Vitex are CPU and memory optimized for high load. In it's core, Vitex is based on the same concepts as in Node.js but made to it's extreme by utilizing powers of raw C++.
This framework introduces quite a few important features from popular game engines, languages like Rust and runtimes like Node.js, including (but not limited to): core agnostic scheduler with blocking/non-blocking/coroutine/timeout/interval tasks, optionals, expectations (no try/catch blocks ever), text serialization formats, ready-to-use coroutines and promises, control over OS level access, common networking protocols, memory tracing and management, stacktraces, logging, data compression, big numbers, high precision integers, cryptographic primitives for different purposes: hashing, symmetric/asymmetric encryption and blockchain required cryptography.
Vitex's core is based on a worker pool that consumes and publishes tasks, there is no concept of main event loop, every thread is on it's own an event loop. Scheduler processes blocking and non-blocking tasks such as event dispatching, non-blocking IO and coroutines, CPU bound tasks and blocking IO. Vitex is made to be as scalable as possible without even thinking about scalability which in turn makes development of multithreaded or concurrent systems quite a lot easier.
Rule of thumb:
- Split up work into small pieces.
- Schedule those small pieces into the queue.
You may take a look at Wiki pages.
- Windows 7/8/8.1/10+ x64/x86 (MSVC, MSVC ClangCL, MinGW)
- Raspberian 3+ ARM (GCC)
- Solaris 9+ x64/x86 (GCC)
- FreeBSD 11+ x64/x86 (GCC)
- Debian 11+ x64/x86 (GCC, LLVM)
- Ubuntu 16.04+ x64/x86 (GCC)
- MacOS Catalina 10.15+ x64 (Xcode)
There are several ways to build this project that are explained here:
- VI_CXX is the C++ standard (17, 20, 23) which will be used, C++20 and higher will replace stateful coroutines with std coroutines, defaults to 20
- VI_LOGGING is a logging level (errors, warnings, default, debug, verbose), defaults to "default"
- VI_PESSIMISTIC will enable assertion statements in release mode, defaults to OFF
- VI_BINDINGS will enable full script bindings otherwise only essentials will be used to reduce lib size, defaults to ON
- VI_ALLOCATOR will enable custom allocator for all used standard containers, making them incompatible with std::allocator based ones but adding opportunity to use pool allocator, defaults to ON
- VI_FCONTEXT will enable internal fcontext implementation for coroutines, defaults to ON
- pugixml (submodule): VI_PUGIXML=ON
- rapidjson (submodule): VI_RAPIDJSON=ON
- zlib (so): VI_ZLIB=ON
- wepoll (submodule): VI_WEPOLL=ON
- openssl (so): VI_OPENSSL=ON
- mongo-c-driver (so): VI_MONGOC=ON
- libpq (so): VI_POSTGRESQL=ON
- sqlite (so): VI_SQLITE=ON
- Scripting angelscript (submodule): VI_ANGELSCRIPT=ON
- Debugging backward-cpp (submodule): VI_BACKWARDCPP=ON
Vitex is licensed under the MIT license
Documentation in it's usual form is non-existant at the moment. In the nearest future that could be changed.