1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00
lokinet/llarp/ev/ev.cpp
Jason Rhinelander ccc7b5c9e9 Merge Logic functions into EventLoop
loop->call(...) is similar to the old logic->Call(...), but is smart
about the current thread: if called from within the event loop it simply
runs the argument directly, otherwise it queues it.

Similarly most of the other event loop calls are also now thread-aware:
for example, `call_later(...)` can queue the job directly when called if
in the event loop rather than having to double-queue through the even
loop (once to call, then inside the call to initiate the time).
2021-03-04 16:51:18 -04:00

20 lines
339 B
C++

#include <ev/ev.hpp>
#include <util/mem.hpp>
#include <util/str.hpp>
#include <cstddef>
#include <cstring>
#include <string_view>
// We libuv now
#include <ev/ev_libuv.hpp>
namespace llarp
{
EventLoop_ptr
EventLoop::create(size_t queueLength)
{
return std::make_shared<llarp::uv::Loop>(queueLength);
}
} // namespace llarp