8 #ifndef WPIUTIL_WPI_UV_WORK_H_
9 #define WPIUTIL_WPI_UV_WORK_H_
16 #include "wpi/Signal.h"
17 #include "wpi/uv/Request.h"
32 Loop& GetLoop()
const {
return *
static_cast<Loop*
>(
GetRaw()->loop->data); }
52 void QueueWork(
Loop& loop,
const std::shared_ptr<WorkReq>& req);
60 inline void QueueWork(
const std::shared_ptr<Loop>& loop,
61 const std::shared_ptr<WorkReq>& req) {
62 QueueWork(*loop, req);
75 void QueueWork(Loop& loop, std::function<
void()> work,
76 std::function<
void()> afterWork);
88 inline void QueueWork(
const std::shared_ptr<Loop>& loop,
89 std::function<
void()> work,
90 std::function<
void()> afterWork) {
91 QueueWork(*loop, work, afterWork);
97 #endif // WPIUTIL_WPI_UV_WORK_H_
sig::Signal work
Function(s) that will be run on the thread pool.
Definition: Work.h:37
WPILib C++ utilities (wpiutil) namespace.
Definition: SmallString.h:21
uv_work_t * GetRaw() noexcept
Get the underlying request data structure.
Definition: Request.h:149
sig::Signal afterWork
Function(s) that will be run on the loop thread after the work on the thread pool has been completed ...
Definition: Work.h:43
Work request.
Definition: Work.h:28
Event loop.
Definition: Loop.h:39
SignalBase is an implementation of the observer pattern, through the use of an emitting object and sl...
Definition: Signal.h:495
Request.
Definition: Request.h:134