QuickIO  0.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
sub.h
Go to the documentation of this file.
1 
12 #pragma once
13 #include "quickio.h"
14 
20 struct subscription {
24  struct event *ev;
25 
29  gchar *ev_extra;
30 
35 
43  guint refs;
44 };
45 
57 struct subscription* sub_get(struct event *ev, const gchar *ev_extra);
58 
65 struct subscription* sub_ref(struct subscription *sub);
66 
74 void sub_unref(struct subscription *sub);
75 
79 void sub_init();
Events are stored in a prefix tree for fast, nice lookups.
Definition: evs.h:184
qev_list_t * subscribers
All of the clients currently listening for this event.
Definition: sub.h:34
struct subscription * sub_get(struct event *ev, const gchar *ev_extra)
Get a subscription.
struct qev_list qev_list_t
Bitch, stop looking at me.
Definition: list.h:18
Every header, definition, and whatnot QuickIO needs to run.
guint refs
Reference count to allow unlocked operations when dealing with subscriptions.
Definition: sub.h:43
Events are what are located at the paths, whereas subscriptions are what are located at ev_path + ev_...
Definition: sub.h:20
void sub_unref(struct subscription *sub)
Release a reference to the subscription, cleaning it up if there are no more references.
struct subscription * sub_ref(struct subscription *sub)
Increase the reference count on the subscription.
gchar * ev_extra
To allow a way to remove sub from ev->subs.
Definition: sub.h:29
struct event * ev
The event that this sub belongs to.
Definition: sub.h:24
void sub_init()
Get subs ready to run.