[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: New API is needed in case stored procedu
From: |
gnunet |
Subject: |
[gnunet] branch master updated: New API is needed in case stored procedures trigger events for our own process. |
Date: |
Fri, 23 Jun 2023 11:37:38 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new 943dcf9c5 New API is needed in case stored procedures trigger events
for our own process.
943dcf9c5 is described below
commit 943dcf9c5097564b34f75122699a743d283d2301
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Jun 23 11:36:43 2023 +0200
New API is needed in case stored procedures trigger events for
our own process.
NEWS: Add new GNUNET_PQ_event_do_poll() API to gnunet_pq_lib.h
---
src/include/gnunet_pq_lib.h | 13 +++++++++++++
src/pq/pq_event.c | 8 ++++----
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/src/include/gnunet_pq_lib.h b/src/include/gnunet_pq_lib.h
index 78eaf0d49..69cf84583 100644
--- a/src/include/gnunet_pq_lib.h
+++ b/src/include/gnunet_pq_lib.h
@@ -1561,6 +1561,19 @@ void
GNUNET_PQ_event_listen_cancel (struct GNUNET_DB_EventHandler *eh);
+/**
+ * Poll for events right now. Useful if we may have
+ * triggered an event for ourselves. Not needed when
+ * using GNUNET_PQ_event_notify(), but useful when
+ * stored procedures may have triggered events.
+ * Does nothing if there are no events.
+ *
+ * @param[in,out] db database to check for events
+ */
+void
+GNUNET_PQ_event_do_poll (struct GNUNET_PQ_Context *db);
+
+
/**
* Notify all that listen on @a es of an event.
*
diff --git a/src/pq/pq_event.c b/src/pq/pq_event.c
index 16bd898fb..fff9e16f7 100644
--- a/src/pq/pq_event.c
+++ b/src/pq/pq_event.c
@@ -185,8 +185,8 @@ do_notify (void *cls,
}
-static void
-event_do_poll (struct GNUNET_PQ_Context *db)
+void
+GNUNET_PQ_event_do_poll (struct GNUNET_PQ_Context *db)
{
PGnotify *n;
unsigned int cnt = 0;
@@ -276,7 +276,7 @@ do_scheduler_notify (void *cls)
db->event_task = NULL;
if (NULL == db->rfd)
GNUNET_PQ_reconnect (db);
- event_do_poll (db);
+ GNUNET_PQ_event_do_poll (db);
if (NULL != db->event_task)
return;
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -577,7 +577,7 @@ GNUNET_PQ_event_notify (struct GNUNET_PQ_Context *db,
PQerrorMessage (db->conn));
}
PQclear (result);
- event_do_poll (db);
+ GNUNET_PQ_event_do_poll (db);
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: New API is needed in case stored procedures trigger events for our own process.,
gnunet <=