Functions
loop.c File Reference
#include <stdarg.h>
#include <stdint.h>
#include <uv.h>
#include "nvim/event/loop.h"
#include "nvim/event/process.h"
#include "nvim/log.h"

Functions

void loop_init (Loop *loop, void *data)
 
bool loop_poll_events (Loop *loop, int ms)
 
void loop_schedule_fast (Loop *loop, Event event)
 
void loop_schedule_deferred (Loop *loop, Event event)
 
void loop_on_put (MultiQueue *queue, void *data)
 
bool loop_close (Loop *loop, bool wait)
 
void loop_purge (Loop *loop)
 
size_t loop_size (Loop *loop)
 

Function Documentation

◆ loop_close()

bool loop_close ( Loop loop,
bool  wait 
)

Closes loop and its handles, and frees its structures.

Parameters
loopLoop to destroy
waitWait briefly for handles to deref
Returns
false if the loop could not be closed gracefully

◆ loop_init()

void loop_init ( Loop loop,
void data 
)

◆ loop_on_put()

void loop_on_put ( MultiQueue queue,
void data 
)

◆ loop_poll_events()

bool loop_poll_events ( Loop loop,
int  ms 
)

Processes one Loop.uv event (at most). Processes all Loop.fast_events events. Does NOT process Loop.events, that is an application-specific decision.

Parameters
loop
ms0: non-blocking poll. >0: timeout after ms. <0: wait forever.
Returns
true if ms timeout was reached

◆ loop_purge()

void loop_purge ( Loop loop)

◆ loop_schedule_deferred()

void loop_schedule_deferred ( Loop loop,
Event  event 
)

Schedules an event from another thread. Unlike loop_schedule_fast(), the event is forwarded to Loop.events, instead of being processed immediately.

See also
loop_schedule_fast

◆ loop_schedule_fast()

void loop_schedule_fast ( Loop loop,
Event  event 
)

Schedules a fast event from another thread.

Note
Event is queued into fast_events, which is processed outside of the primary events queue by loop_poll_events(). For main_loop, that means fast_events is NOT processed in an "editor mode" (VimState.execute), so redraw and other side-effects are likely to be skipped.
See also
loop_schedule_deferred

◆ loop_size()

size_t loop_size ( Loop loop)