https://github.com/kezhengjie/coroutinetool
functional c++ tiny lib based on c++20 coroutine,for learning and utility purpose.
https://github.com/kezhengjie/coroutinetool
async-executor coroutine cpp cpp-coroutines cpp20 cpp20-library fluent modern shell-command shell-executor system-commands
Last synced: 3 months ago
JSON representation
functional c++ tiny lib based on c++20 coroutine,for learning and utility purpose.
- Host: GitHub
- URL: https://github.com/kezhengjie/coroutinetool
- Owner: kezhengjie
- License: mit
- Created: 2022-07-16T07:19:46.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-16T16:47:06.000Z (almost 3 years ago)
- Last Synced: 2025-01-09T13:31:46.176Z (4 months ago)
- Topics: async-executor, coroutine, cpp, cpp-coroutines, cpp20, cpp20-library, fluent, modern, shell-command, shell-executor, system-commands
- Language: C++
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# coroutinetool
functional c++ tiny lib based on c++20 coroutine,for learning and utility purpose.currently a async shell executor implemented.You could run system command in place with calling `fgets` etc...
## Start
```c++
#include "async_shell_executor.h"
#includeusing namespace std;
using namespace coroutinetool;int main(int argc, char **argv)
{
auto ae = AsyncExecutor::Run("ipconfig");
while (ae)
cout << ae();
cout << "return code is: " << ae.Code() << endl;
ae = AsyncExecutor::Run("ipconfig");
while (ae)
cout << ae();
cout << "return code is: " << ae.Code() << endl;
}
```