# beman_task **Repository Path**: yutao1115/beman_task ## Basic Information - **Project Name**: beman_task - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-12-05 - **Last Updated**: 2025-12-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # beman.task: Beman Library Implementation of `task` (P3552) ![Continuous Integration Tests](https://github.com/bemanproject/task/actions/workflows/ci_tests.yml/badge.svg) ![Target Standard](https://github.com/bemanproject/beman/blob/main/images/badges/cpp26.svg) [![Coverage](https://coveralls.io/repos/github/bemanproject/task/badge.svg?branch=main)](https://coveralls.io/github/bemanproject/task?branch=main) `beman::execution::task` is a class template which is used as the the type of coroutine tasks. The corresponding objects are senders. The first template argument (`T`) defines the result type which becomes a `set_value_t(T)` completion signatures. The second template argument (`Context`) provides a way to configure the behavior of the coroutine. By default it can be left alone. Implements: `std::execution::task` proposed in [Add a Coroutine Lazy Type (P3552)](https://wg21.link/P3552). ## Usage The following code snippet shows a basic use of `beman::task::task` using sender/receiver facilities to implement version of `hello, world`: ```cpp #include #include #include namespace ex = beman::execution; namespace ly = beman::task; int main() { return std::get<0>(*ex::sync_wait([]->ex::task { std::cout << "Hello, world!\n"; co_return co_await ex::just(0); }())); } ``` Full runnable examples can be found in [`examples/`](`./example`) (e.g., [`./examples/hello.cpp`](./examples/hello.cpp)). For some explanation see [`./docs/examples.md`](./docs/examples.md). ## Help Welcome There are plenty of things which need to be done. See the [contributions page](https://github.com/bemanproject/task/blob/main/docs/contributing.md) for some ideas how to contribute. The [resources page](https://github.com/bemanproject/task/blob/main/docs/resources.md) contains some links for general information about coroutines. ## Building beman.task ### Dependencies This project depends on [`beman::execution`](https://github.com/bemanproject/execution) (which will be automatically obtained using `cmake`'s `FetchContent*`). Build-time dependencies: - `cmake` - `ninja`, `make`, or another CMake-supported build system - CMake defaults to "Unix Makefiles" on POSIX systems ### How to build beman.task This project strives to be as normal and simple a CMake project as possible. This build workflow in particular will work, producing a static `libbeman.task.a` library, ready to package with its headers: ```shell # Build beman.task. $ cmake --workflow --preset gcc-debug $ cmake --workflow --preset gcc-release # Install beman.task into your system. $ cmake --install build/gcc-release/ --prefix /opt/beman.task/ -- Install configuration: "RelWithDebInfo" -- Installing: /opt/beman.task/lib/libbeman.task.a -- Installing: /opt/beman.task/include/beman/task/task.hpp [...] $ tree /opt/beman.task/ /opt/beman.task/ ├── include │   └── beman │   └── task │   ├── detail │   │   ├── affine_on.hpp │   │   ├── ... │   │   ├── task.hpp │   │   └── with_error.hpp │   └── task.hpp └── lib ├── cmake │   └── beman │   └── task │   └── BemanTaskConfig.cmake └── libbeman.task.a 9 directories, 26 files ``` ## Contributing Please do! Issues and pull requests are appreciated.