diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-05-02 17:27:36 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-05-02 17:27:42 +0200 |
commit | 7fc3ecc8e8859e8cd47c37457f7991460d81b1ed (patch) | |
tree | baab47fe05f324b10263bcd92828d74ffc1a5b63 /src/include/gnunet_namestore_service.h | |
parent | 32cc463b677a8bc46b61111fe1bbc38554cb2ca0 (diff) | |
download | gnunet-7fc3ecc8e8859e8cd47c37457f7991460d81b1ed.tar.gz gnunet-7fc3ecc8e8859e8cd47c37457f7991460d81b1ed.zip |
start preparations for flow control by namestore monitors
Diffstat (limited to 'src/include/gnunet_namestore_service.h')
-rw-r--r-- | src/include/gnunet_namestore_service.h | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/include/gnunet_namestore_service.h b/src/include/gnunet_namestore_service.h index 4828f72ad..b8c7ea810 100644 --- a/src/include/gnunet_namestore_service.h +++ b/src/include/gnunet_namestore_service.h | |||
@@ -109,6 +109,12 @@ typedef void | |||
109 | * it is replaced with the new record. Use an empty array to | 109 | * it is replaced with the new record. Use an empty array to |
110 | * remove all records under the given name. | 110 | * remove all records under the given name. |
111 | * | 111 | * |
112 | * The continuation is called after the value has been stored in the | ||
113 | * database. Monitors may be notified asynchronously (basically with | ||
114 | * a buffer). However, if any monitor is consistently too slow to | ||
115 | * keep up with the changes, calling @a cont will be delayed until the | ||
116 | * monitors do keep up. | ||
117 | * | ||
112 | * @param h handle to the namestore | 118 | * @param h handle to the namestore |
113 | * @param pkey private key of the zone | 119 | * @param pkey private key of the zone |
114 | * @param label name that is being mapped | 120 | * @param label name that is being mapped |
@@ -313,7 +319,7 @@ struct GNUNET_NAMESTORE_ZoneMonitor; | |||
313 | * that monitoring is down. You need to still explicitly call | 319 | * that monitoring is down. You need to still explicitly call |
314 | * #GNUNET_NAMESTORE_zone_monitor_stop(). | 320 | * #GNUNET_NAMESTORE_zone_monitor_stop(). |
315 | * @param error_cb_cls closure for @a error_cb | 321 | * @param error_cb_cls closure for @a error_cb |
316 | * @param monitor function to call on zone changes | 322 | * @param monitor function to call on zone changes, with an initial limit of 1 |
317 | * @param monitor_cls closure for @a monitor | 323 | * @param monitor_cls closure for @a monitor |
318 | * @param sync_cb function called when we're in sync with the namestore | 324 | * @param sync_cb function called when we're in sync with the namestore |
319 | * @param sync_cb_cls closure for @a sync_cb | 325 | * @param sync_cb_cls closure for @a sync_cb |
@@ -332,6 +338,32 @@ GNUNET_NAMESTORE_zone_monitor_start (const struct GNUNET_CONFIGURATION_Handle *c | |||
332 | 338 | ||
333 | 339 | ||
334 | /** | 340 | /** |
341 | * Calls the monitor processor specified in #GNUNET_NAMESTORE_zone_monitor_start | ||
342 | * for the next record(s). This function is used to allow clients that merely | ||
343 | * monitor the NAMESTORE to still throttle namestore operations, so we can be | ||
344 | * sure that the monitors can keep up. | ||
345 | * | ||
346 | * Note that #GNUNET_NAMESTORE_records_store() only waits for this | ||
347 | * call if the previous limit set by the client was already reached. | ||
348 | * Thus, by using a @a limit greater than 1, monitors basically enable | ||
349 | * a queue of notifications to be processed asynchronously with some | ||
350 | * delay. Note that even with a limit of 1 the | ||
351 | * #GNUNET_NAMESTORE_records_store() function will run asynchronously | ||
352 | * and the continuation may be invoked before the monitors completed | ||
353 | * (or even started) processing the notification. Thus, monitors will | ||
354 | * only closely track the current state of the namestore, but not | ||
355 | * be involved in the transactions. | ||
356 | * | ||
357 | * @param zm the monitor | ||
358 | * @param limit number of records to return to the iterator in one shot | ||
359 | * (before #GNUNET_NAMESTORE_zone_monitor_next is to be called again) | ||
360 | */ | ||
361 | void | ||
362 | GNUNET_NAMESTORE_zone_monitor_next (struct GNUNET_NAMESTORE_ZoneMonitor *zm, | ||
363 | uint64_t limit); | ||
364 | |||
365 | |||
366 | /** | ||
335 | * Stop monitoring a zone for changes. | 367 | * Stop monitoring a zone for changes. |
336 | * | 368 | * |
337 | * @param zm handle to the monitor activity to stop | 369 | * @param zm handle to the monitor activity to stop |