#include "lix/libutil/error.hh"
#include "lix/libutil/result.hh"
#include "lix/libutil/signals.hh"
#include <future>
#include <kj/async-io.h>
#include <kj/async.h>
#include <optional>
#include <source_location>
Go to the source code of this file.
|
|
AsyncContext & | nix::AIO () |
|
void | nix::detail::materializeResult (Result< void > r) |
|
template<typename T> |
| T | nix::detail::materializeResult (Result< T > r) |
|
template<typename T> |
| T | nix::detail::runAsyncUnwrap (T t) |
|
template<typename T> |
| T | nix::detail::runAsyncUnwrap (Result< T > t) |
|
auto | nix::detail::runAsyncInNewThread (std::invocable< AsyncIoRoot & > auto fn) |
◆ LIX_RUN_ASYNC_IN_NEW_THREAD
| #define LIX_RUN_ASYNC_IN_NEW_THREAD |
( |
| ... | ) |
|
Value: ::nix::detail::runAsyncInNewThread([&](AsyncIoRoot & AIOROOT) { \
return AIOROOT.blockOn(__VA_ARGS__); \
})
◆ LIX_TRY_AWAIT
| #define LIX_TRY_AWAIT |
( |
| ... | ) |
|
Value:LIX_TRY_AWAIT_CONTEXT(lixAsyncTaskContext, __VA_ARGS__)
◆ LIX_TRY_AWAIT_CONTEXT
| #define LIX_TRY_AWAIT_CONTEXT |
( |
| ctx, |
|
|
| ... ) |
Value: ({ \
auto _lix_awaited = co_await (__VA_ARGS__); \
if (_lix_awaited.has_error()) { \
try { \
_lix_awaited.value(); \
e.addAsyncTrace(::std::source_location::current(), ctx()); \
throw; \
} catch (::std::exception & e) { \
::nix::ForeignException fe(e); \
fe.addAsyncTrace(::std::source_location::current(), ctx()); \
throw fe; \
} \
} \
::nix::detail::materializeResult(std::move(_lix_awaited)); \
})