Function configure


#include <src/uvw/loop.h>

template <typename... Args>
void configure(Configure flag, Args &&... args)


Sets additional loop options.

You should normally call this before the first call to uv_run() unless mentioned otherwise.
Supported options:

  • Loop::Configure::BLOCK_SIGNAL: Block a signal when polling for new events. A second argument is required and it is the signal number.
  • Loop::Configure::IDLE_TIME: Accumulate the amount of idle time the event loop spends in the event provider. This option is necessary to use idleTime().

An ErrorEvent will be emitted in case of errors.

See the official documentation for further details.


Lines 148-153 in src/uvw/loop.h.

template<typename... Args>
void configure(Configure flag, Args&&... args) {
    auto option = static_cast<std::underlying_type_t<Configure>>(flag);
    auto err = uv_loop_configure(loop.get(), static_cast<uv_loop_option>(option), std::forward<Args>(args)...);
    if(err) { publish(ErrorEvent{err}); }

Add Discussion as Guest

Log in