aboutsummaryrefslogtreecommitdiff
path: root/src/pq/pq.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pq/pq.h')
-rw-r--r--src/pq/pq.h40
1 files changed, 23 insertions, 17 deletions
diff --git a/src/pq/pq.h b/src/pq/pq.h
index 107fd116c..950d38220 100644
--- a/src/pq/pq.h
+++ b/src/pq/pq.h
@@ -28,6 +28,7 @@
28#include "gnunet_util_lib.h" 28#include "gnunet_util_lib.h"
29#include "gnunet_pq_lib.h" 29#include "gnunet_pq_lib.h"
30 30
31
31/** 32/**
32 * Handle to Postgres database. 33 * Handle to Postgres database.
33 */ 34 */
@@ -59,26 +60,11 @@ struct GNUNET_PQ_Context
59 char *load_path; 60 char *load_path;
60 61
61 /** 62 /**
62 * Function to call on Postgres FDs.
63 */
64 GNUNET_PQ_SocketCallback sc;
65
66 /**
67 * Closure for @e sc.
68 */
69 void *sc_cls;
70
71 /**
72 * Map managing event subscriptions. 63 * Map managing event subscriptions.
73 */ 64 */
74 struct GNUNET_CONTAINER_MultiShortmap *channel_map; 65 struct GNUNET_CONTAINER_MultiShortmap *channel_map;
75 66
76 /** 67 /**
77 * Lock to access @e channel_map.
78 */
79 pthread_mutex_t notify_lock;
80
81 /**
82 * Task responsible for processing events. 68 * Task responsible for processing events.
83 */ 69 */
84 struct GNUNET_SCHEDULER_Task *event_task; 70 struct GNUNET_SCHEDULER_Task *event_task;
@@ -87,7 +73,7 @@ struct GNUNET_PQ_Context
87 * File descriptor wrapper for @e event_task. 73 * File descriptor wrapper for @e event_task.
88 */ 74 */
89 struct GNUNET_NETWORK_Handle *rfd; 75 struct GNUNET_NETWORK_Handle *rfd;
90 76
91 /** 77 /**
92 * Is scheduling via the GNUnet scheduler desired? 78 * Is scheduling via the GNUnet scheduler desired?
93 */ 79 */
@@ -100,9 +86,29 @@ struct GNUNET_PQ_Context
100 * after a disconnect. 86 * after a disconnect.
101 * 87 *
102 * @param db the DB handle 88 * @param db the DB handle
89 * @param fd socket to listen on
90 */
91void
92GNUNET_PQ_event_reconnect_ (struct GNUNET_PQ_Context *db,
93 int fd);
94
95
96/**
97 * Run poll event loop using the GNUnet scheduler.
98 *
99 * @param db database handle
100 */
101void
102GNUNET_PQ_event_scheduler_start_ (struct GNUNET_PQ_Context *db);
103
104
105/**
106 * Stop running poll event loop using the GNUnet scheduler.
107 *
108 * @param db database handle
103 */ 109 */
104void 110void
105GNUNET_PQ_event_reconnect_ (struct GNUNET_PQ_Context *db); 111GNUNET_PQ_event_scheduler_stop_ (struct GNUNET_PQ_Context *db);
106 112
107 113
108#endif 114#endif