Condy v1.9
C++ Asynchronous System Call Layer for Linux
Loading...
Searching...
No Matches
module-hello.cpp
Go to the documentation of this file.
1
5
6#include <coroutine>
7#include <string>
8#include <unistd.h>
9
10import condy;
11
12condy::Coro<> co_main() {
13 std::string msg = "Hello, Condy (via module)!\n";
14 co_await condy::async_write(STDOUT_FILENO, condy::buffer(msg), 0);
15}
16
17int main() noexcept(false) { condy::sync_wait(co_main()); }
Coroutine type used to define a coroutine function.
Definition coro.hpp:25
T sync_wait(Runtime &runtime, Coro< T, Allocator > coro)
Synchronously wait for a coroutine to complete in the given runtime.
Definition sync_wait.hpp:25
MutableBuffer buffer(void *data, size_t size) noexcept
Create a buffer object from various data sources.
Definition buffers.hpp:86
auto async_write(Fd fd, const Buffer &buf, __u64 offset, int flags=0)
See io_uring_prep_write.