Data Structures | Typedefs | Functions
multiqueue.c File Reference
#include <assert.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <uv.h>
#include "nvim/event/multiqueue.h"
#include "nvim/memory.h"
#include "nvim/os/time.h"

Data Structures

struct  multiqueue_item
 
struct  multiqueue
 
struct  MulticastEvent
 

Typedefs

typedef struct multiqueue_item MultiQueueItem
 

Functions

MultiQueuemultiqueue_new_parent (put_callback put_cb, void *data)
 
MultiQueuemultiqueue_new_child (MultiQueue *parent) FUNC_ATTR_NONNULL_ALL
 
void multiqueue_free (MultiQueue *this)
 
Event multiqueue_get (MultiQueue *this)
 Removes the next item and returns its Event. More...
 
void multiqueue_put_event (MultiQueue *this, Event event)
 
void multiqueue_process_events (MultiQueue *this)
 
void multiqueue_purge_events (MultiQueue *this)
 Removes all events without processing them. More...
 
bool multiqueue_empty (MultiQueue *this)
 
void multiqueue_replace_parent (MultiQueue *this, MultiQueue *new_parent)
 
size_t multiqueue_size (MultiQueue *this)
 Gets the count of all events currently in the queue. More...
 
Event event_create_oneshot (Event ev, int num)
 

Typedef Documentation

Function Documentation

Event event_create_oneshot ( Event  ev,
int  num 
)

Multicasts a one-shot event to multiple queues.

The handler will be invoked once by the first queue that consumes the event. Later processing will do nothing (just memory cleanup).

Parameters
evEvent
numNumber of queues that the event will be put on
Returns
Event that is safe to put onto num queues
bool multiqueue_empty ( MultiQueue this)
void multiqueue_free ( MultiQueue this)
Event multiqueue_get ( MultiQueue this)

Removes the next item and returns its Event.

MultiQueue* multiqueue_new_child ( MultiQueue parent)
MultiQueue* multiqueue_new_parent ( put_callback  put_cb,
void *  data 
)
void multiqueue_process_events ( MultiQueue this)
void multiqueue_purge_events ( MultiQueue this)

Removes all events without processing them.

void multiqueue_put_event ( MultiQueue this,
Event  event 
)
void multiqueue_replace_parent ( MultiQueue this,
MultiQueue new_parent 
)
size_t multiqueue_size ( MultiQueue this)

Gets the count of all events currently in the queue.