https://github.com/prophetru/bulkcmdasync
Educational project
https://github.com/prophetru/bulkcmdasync
async cmake conditional cpp doxygen gtest lib mutex otus queue variables
Last synced: 3 months ago
JSON representation
Educational project
- Host: GitHub
- URL: https://github.com/prophetru/bulkcmdasync
- Owner: ProphetRu
- License: apache-2.0
- Created: 2024-04-12T14:00:47.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-12T14:50:14.000Z (almost 2 years ago)
- Last Synced: 2025-02-17T22:34:46.879Z (12 months ago)
- Topics: async, cmake, conditional, cpp, doxygen, gtest, lib, mutex, otus, queue, variables
- Language: C++
- Homepage:
- Size: 254 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BulkCmd Async
Educational project with [googletest](https://github.com/google/googletest) and [doxygen](https://github.com/doxygen/doxygen)
## Build local Linux
```shell
sudo apt-get update && sudo apt-get install cmake libgtest-dev -y
cd BulkCmdAsync
mkdir build && cd build
cmake ..
# build release
cmake --build . --config Release
# build deb-package
cmake --build . --target package
```
## Build local Windows
```shell
vcpkg install gtest
vcpkg integrate install
cd BulkCmdAsync
mkdir build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE="path/to/vcpkg/scripts/buildsystems/vcpkg.cmake"
# build release
cmake --build . --config Release
```
## Usage
```cpp
#include "async.h"
int main()
{
std::size_t bulk = 5;
auto h = async::connect(bulk);
auto h2 = async::connect(bulk);
async::receive(h, "1", 1);
async::receive(h2, "1\n", 2);
async::receive(h, "\n2\n3\n4\n5\n6\n{\na\n", 15);
async::receive(h, "b\nc\nd\n}\n89\n", 11);
async::disconnect(h);
async::disconnect(h2);
return 0;
}
```