aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_pq_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-08-22 23:59:54 +0200
committerChristian Grothoff <christian@grothoff.org>2021-08-22 23:59:54 +0200
commitea901fb4978ee7e9cfd2f74c810f2146bdf9d46b (patch)
treef2bbad92955ed144bc6afa9a03ece372c20a874a /src/include/gnunet_pq_lib.h
parent9ef7f0704fa0458f2e27ba188aec5102dbb780b2 (diff)
downloadgnunet-ea901fb4978ee7e9cfd2f74c810f2146bdf9d46b.tar.gz
gnunet-ea901fb4978ee7e9cfd2f74c810f2146bdf9d46b.zip
-simplify libgnunetpq to only support single-threaded applications that do use the scheudler (when using event API)
Diffstat (limited to 'src/include/gnunet_pq_lib.h')
-rw-r--r--src/include/gnunet_pq_lib.h49
1 files changed, 3 insertions, 46 deletions
diff --git a/src/include/gnunet_pq_lib.h b/src/include/gnunet_pq_lib.h
index ecc2b9719..ff4498938 100644
--- a/src/include/gnunet_pq_lib.h
+++ b/src/include/gnunet_pq_lib.h
@@ -853,33 +853,6 @@ GNUNET_PQ_reconnect (struct GNUNET_PQ_Context *db);
853 853
854 854
855/** 855/**
856 * Function called whenever the socket needed for
857 * notifications from postgres changes.
858 *
859 * @param cls closure
860 * @param fd socket to listen on, -1 for none
861 */
862typedef void
863(*GNUNET_PQ_SocketCallback)(void *cls,
864 int fd);
865
866
867/**
868 * Obtain the file descriptor to poll on for notifications.
869 * Useful if the GNUnet scheduler is NOT to be used for
870 * such notifications.
871 *
872 * @param db database handle
873 * @param sc function to call with the socket
874 * @param sc_cls closure for @a sc
875 */
876void
877GNUNET_PQ_event_set_socket_callback (struct GNUNET_PQ_Context *db,
878 GNUNET_PQ_SocketCallback sc,
879 void *sc_cls);
880
881
882/**
883 * Poll for database events now. Used if the event FD 856 * Poll for database events now. Used if the event FD
884 * is ready and the application wants to trigger applicable 857 * is ready and the application wants to trigger applicable
885 * events. 858 * events.
@@ -893,24 +866,6 @@ GNUNET_PQ_event_do_poll (struct GNUNET_PQ_Context *db);
893 866
894 867
895/** 868/**
896 * Run poll event loop using the GNUnet scheduler.
897 *
898 * @param db database handle
899 */
900void
901GNUNET_PQ_event_scheduler_start (struct GNUNET_PQ_Context *db);
902
903
904/**
905 * Stop running poll event loop using the GNUnet scheduler.
906 *
907 * @param db database handle
908 */
909void
910GNUNET_PQ_event_scheduler_stop (struct GNUNET_PQ_Context *db);
911
912
913/**
914 * Register callback to be invoked on events of type @a es. 869 * Register callback to be invoked on events of type @a es.
915 * 870 *
916 * Unlike many other calls, this function is thread-safe 871 * Unlike many other calls, this function is thread-safe
@@ -921,14 +876,16 @@ GNUNET_PQ_event_scheduler_stop (struct GNUNET_PQ_Context *db);
921 * 876 *
922 * @param db database context to use 877 * @param db database context to use
923 * @param es specification of the event to listen for 878 * @param es specification of the event to listen for
879 * @param timeout when to trigger @a cb based on timeout
924 * @param cb function to call when the event happens, possibly 880 * @param cb function to call when the event happens, possibly
925 * multiple times (until #GNUNET_PQ_event_listen_cancel() is invoked) 881 * multiple times (until #GNUNET_PQ_event_listen_cancel() is invoked), including on timeout
926 * @param cb_cls closure for @a cb 882 * @param cb_cls closure for @a cb
927 * @return handle useful to cancel the listener 883 * @return handle useful to cancel the listener
928 */ 884 */
929struct GNUNET_DB_EventHandler * 885struct GNUNET_DB_EventHandler *
930GNUNET_PQ_event_listen (struct GNUNET_PQ_Context *db, 886GNUNET_PQ_event_listen (struct GNUNET_PQ_Context *db,
931 const struct GNUNET_DB_EventHeaderP *es, 887 const struct GNUNET_DB_EventHeaderP *es,
888 struct GNUNET_TIME_Relative timeout,
932 GNUNET_DB_EventCallback cb, 889 GNUNET_DB_EventCallback cb,
933 void *cb_cls); 890 void *cb_cls);
934 891