Condy
v1.8
C++ Asynchronous System Call Layer for Linux
Loading...
Searching...
No Matches
helpers.hpp
Go to the documentation of this file.
1
8
9
#pragma once
10
11
#include "
condy/concepts.hpp
"
12
#include <utility>
13
14
namespace
condy
{
15
namespace
detail {
16
17
template
<
typename
CoroFunc>
struct
SpawnHelper {
18
void
operator()(
auto
&&res)
noexcept
{
19
co_spawn
(func(std::forward<
decltype
(res)>(res))).detach();
20
}
21
CoroFunc func;
22
};
23
24
template
<
typename
Channel>
struct
PushHelper {
25
void
operator()(
auto
&&res)
noexcept
{
26
channel.force_push(std::forward<
decltype
(res)>(res));
27
}
28
Channel &channel;
29
};
30
31
struct
FixedFd {
32
int
value;
33
operator
int()
const
{
return
value; }
34
};
35
36
template
<
typename
T>
struct
FixedBuffer {
37
T value;
38
int
buf_index;
39
};
40
41
}
// namespace detail
42
}
// namespace condy
concepts.hpp
condy
The main namespace for the Condy library.
Definition
condy.hpp:37
condy::co_spawn
Task< T, Allocator > co_spawn(Runtime &runtime, Coro< T, Allocator > coro) noexcept
Spawn a coroutine as a task in the given runtime.
Definition
task.hpp:101
include
condy
detail
helpers.hpp
Generated by
1.15.0