Function walk

Synopsis

#include <src/uvw/loop.h>

void walk(std::function< void(BaseHandle &)> callback)

Description

Walks the list of handles.

The callback will be executed once for each handle that is still active.

Parameters

callback - A function to be invoked once for each active handle.

Mentioned in

Source

Lines 110-117 in src/uvw/loop.cpp. Line 337 in src/uvw/loop.h.

UVW_INLINE void Loop::walk(std::function<void(BaseHandle &)> callback) {
    // remember: non-capturing lambdas decay to pointers to functions
    uv_walk(loop.get(), [](uv_handle_t *handle, void *func) {
        BaseHandle &ref = *static_cast<BaseHandle *>(handle->data);
        std::function<void(BaseHandle &)> &f = *static_cast<std::function<void(BaseHandle &)> *>(func);
        f(ref);
    }, &callback);
}





Add Discussion as Guest

Log in