Class IdleHandle

Synopsis

#include <src/uvw/idle.h>

class IdleHandle final: public Handle<IdleHandle, uv_idle_t>

Description

The IdleHandle handle.

Idle handles will emit a IdleEvent event once per loop iteration, right before the PrepareHandle handles.

The notable difference with prepare handles is that when there are active idle handles, the loop will perform a zero timeout poll instead of blocking for I/O.

Note
Despite the name, idle handles will emit events on every loop iteration, not when the loop is actually idle.
To create an IdleHandle through a Loop, no arguments are required.

Inheritance

Ancestors: Handle

Methods

initInitializes the handle.
startStarts the handle.
stopStops the handle.

Source

Lines 37-61 in src/uvw/idle.h.

class IdleHandle final: public Handle<IdleHandle, uv_idle_t> {
    static void startCallback(uv_idle_t *handle);

public:
    using Handle::Handle;

    /**
     * @brief Initializes the handle.
     * @return True in case of success, false otherwise.
     */
    bool init();

    /**
     * @brief Starts the handle.
     *
     * A IdleEvent event will be emitted once per loop iteration, right before
     * polling the PrepareHandle handles.
     */
    void start();

    /**
     * @brief Stops the handle.
     */
    void stop();
};





Add Discussion as Guest

Log in