Condy v1.9
C++ Asynchronous System Call Layer for Linux
Loading...
Searching...
No Matches
awaiter_operations.hpp
Go to the documentation of this file.
1
9
10#pragma once
11
12#include "condy/concepts.hpp"
14
15namespace condy {
16
26template <PrepFuncLike PrepFunc, CQEHandlerLike CQEHandler>
27auto build_op_awaiter(PrepFunc &&func, CQEHandler &&cqe_handler) {
28 return build_op_sender(std::forward<PrepFunc>(func),
29 std::forward<CQEHandler>(cqe_handler));
30}
31
44template <PrepFuncLike PrepFunc, CQEHandlerLike CQEHandler,
45 typename MultiShotFunc>
46auto build_multishot_op_awaiter(PrepFunc &&func, CQEHandler &&cqe_handler,
47 MultiShotFunc &&multishot_func) {
48 return build_multishot_op_sender(
49 std::forward<PrepFunc>(func), std::forward<CQEHandler>(cqe_handler),
50 std::forward<MultiShotFunc>(multishot_func));
51}
52
64template <PrepFuncLike PrepFunc, CQEHandlerLike CQEHandler, typename FreeFunc>
65auto build_zero_copy_op_awaiter(PrepFunc &&func, CQEHandler &&cqe_handler,
66 FreeFunc &&free_func) {
67 return build_zero_copy_op_sender(std::forward<PrepFunc>(func),
68 std::forward<CQEHandler>(cqe_handler),
69 std::forward<FreeFunc>(free_func));
70}
71
72} // namespace condy
The main namespace for the Condy library.
Definition condy.hpp:37
auto build_zero_copy_op_awaiter(PrepFunc &&func, CQEHandler &&cqe_handler, FreeFunc &&free_func)
Build a zero-copy operation awaiter with custom CQE handler.
auto build_op_awaiter(PrepFunc &&func, CQEHandler &&cqe_handler)
Build a single-shot operation awaiter with custom CQE handler.
auto build_multishot_op_awaiter(PrepFunc &&func, CQEHandler &&cqe_handler, MultiShotFunc &&multishot_func)
Build a multi-shot operation awaiter with custom CQE handler.
Helper functions for composing asynchronous operations.