aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_datastore_service.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-05-13 13:43:35 +0000
committerChristian Grothoff <christian@grothoff.org>2010-05-13 13:43:35 +0000
commit5e6ff76c94890e47b51f8bd555437c0ee181e851 (patch)
tree6cc524b94fd92b4430f4e9512183aceb0007fec4 /src/include/gnunet_datastore_service.h
parentbaaedd4fdfb10fc28d9923be9e1d28663d621eca (diff)
downloadgnunet-5e6ff76c94890e47b51f8bd555437c0ee181e851.tar.gz
gnunet-5e6ff76c94890e47b51f8bd555437c0ee181e851.zip
add cancellation
Diffstat (limited to 'src/include/gnunet_datastore_service.h')
-rw-r--r--src/include/gnunet_datastore_service.h43
1 files changed, 36 insertions, 7 deletions
diff --git a/src/include/gnunet_datastore_service.h b/src/include/gnunet_datastore_service.h
index e2de185bd..9d3a4ceb0 100644
--- a/src/include/gnunet_datastore_service.h
+++ b/src/include/gnunet_datastore_service.h
@@ -105,8 +105,11 @@ typedef void (*GNUNET_DATASTORE_ContinuationWithStatus)(void *cls,
105 * @param cont continuation to call when done; "success" will be set to 105 * @param cont continuation to call when done; "success" will be set to
106 * a positive reservation value if space could be reserved. 106 * a positive reservation value if space could be reserved.
107 * @param cont_cls closure for cont 107 * @param cont_cls closure for cont
108 * @return NULL if the entry was not queued, otherwise a handle that can be used to
109 * cancel; note that even if NULL is returned, the callback will be invoked
110 * (or rather, will already have been invoked)
108 */ 111 */
109void 112struct GNUNET_DATASTORE_QueueEntry *
110GNUNET_DATASTORE_reserve (struct GNUNET_DATASTORE_Handle *h, 113GNUNET_DATASTORE_reserve (struct GNUNET_DATASTORE_Handle *h,
111 uint64_t amount, 114 uint64_t amount,
112 uint32_t entries, 115 uint32_t entries,
@@ -138,8 +141,11 @@ GNUNET_DATASTORE_reserve (struct GNUNET_DATASTORE_Handle *h,
138 * @param timeout timeout for the operation 141 * @param timeout timeout for the operation
139 * @param cont continuation to call when done 142 * @param cont continuation to call when done
140 * @param cont_cls closure for cont 143 * @param cont_cls closure for cont
144 * @return NULL if the entry was not queued, otherwise a handle that can be used to
145 * cancel; note that even if NULL is returned, the callback will be invoked
146 * (or rather, will already have been invoked)
141 */ 147 */
142void 148struct GNUNET_DATASTORE_QueueEntry *
143GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h, 149GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h,
144 int rid, 150 int rid,
145 const GNUNET_HashCode * key, 151 const GNUNET_HashCode * key,
@@ -173,8 +179,11 @@ GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h,
173 * @param timeout how long to wait at most for a response 179 * @param timeout how long to wait at most for a response
174 * @param cont continuation to call when done 180 * @param cont continuation to call when done
175 * @param cont_cls closure for cont 181 * @param cont_cls closure for cont
182 * @return NULL if the entry was not queued, otherwise a handle that can be used to
183 * cancel; note that even if NULL is returned, the callback will be invoked
184 * (or rather, will already have been invoked)
176 */ 185 */
177void 186struct GNUNET_DATASTORE_QueueEntry *
178GNUNET_DATASTORE_release_reserve (struct GNUNET_DATASTORE_Handle *h, 187GNUNET_DATASTORE_release_reserve (struct GNUNET_DATASTORE_Handle *h,
179 int rid, 188 int rid,
180 unsigned int queue_priority, 189 unsigned int queue_priority,
@@ -197,8 +206,11 @@ GNUNET_DATASTORE_release_reserve (struct GNUNET_DATASTORE_Handle *h,
197 * @param timeout how long to wait at most for a response 206 * @param timeout how long to wait at most for a response
198 * @param cont continuation to call when done 207 * @param cont continuation to call when done
199 * @param cont_cls closure for cont 208 * @param cont_cls closure for cont
209 * @return NULL if the entry was not queued, otherwise a handle that can be used to
210 * cancel; note that even if NULL is returned, the callback will be invoked
211 * (or rather, will already have been invoked)
200 */ 212 */
201void 213struct GNUNET_DATASTORE_QueueEntry *
202GNUNET_DATASTORE_update (struct GNUNET_DATASTORE_Handle *h, 214GNUNET_DATASTORE_update (struct GNUNET_DATASTORE_Handle *h,
203 unsigned long long uid, 215 unsigned long long uid,
204 uint32_t priority, 216 uint32_t priority,
@@ -227,8 +239,11 @@ GNUNET_DATASTORE_update (struct GNUNET_DATASTORE_Handle *h,
227 * @param timeout how long to wait at most for a response 239 * @param timeout how long to wait at most for a response
228 * @param cont continuation to call when done 240 * @param cont continuation to call when done
229 * @param cont_cls closure for cont 241 * @param cont_cls closure for cont
242 * @return NULL if the entry was not queued, otherwise a handle that can be used to
243 * cancel; note that even if NULL is returned, the callback will be invoked
244 * (or rather, will already have been invoked)
230 */ 245 */
231void 246struct GNUNET_DATASTORE_QueueEntry *
232GNUNET_DATASTORE_remove (struct GNUNET_DATASTORE_Handle *h, 247GNUNET_DATASTORE_remove (struct GNUNET_DATASTORE_Handle *h,
233 const GNUNET_HashCode *key, 248 const GNUNET_HashCode *key,
234 uint32_t size, 249 uint32_t size,
@@ -282,8 +297,11 @@ typedef void (*GNUNET_DATASTORE_Iterator) (void *cls,
282 * @param iter function to call on each matching value; 297 * @param iter function to call on each matching value;
283 * will be called once with a NULL value at the end 298 * will be called once with a NULL value at the end
284 * @param iter_cls closure for iter 299 * @param iter_cls closure for iter
300 * @return NULL if the entry was not queued, otherwise a handle that can be used to
301 * cancel; note that even if NULL is returned, the callback will be invoked
302 * (or rather, will already have been invoked)
285 */ 303 */
286void 304struct GNUNET_DATASTORE_QueueEntry *
287GNUNET_DATASTORE_get (struct GNUNET_DATASTORE_Handle *h, 305GNUNET_DATASTORE_get (struct GNUNET_DATASTORE_Handle *h,
288 const GNUNET_HashCode * key, 306 const GNUNET_HashCode * key,
289 enum GNUNET_BLOCK_Type type, 307 enum GNUNET_BLOCK_Type type,
@@ -319,8 +337,11 @@ GNUNET_DATASTORE_get_next (struct GNUNET_DATASTORE_Handle *h,
319 * will be called once with a value (if available) 337 * will be called once with a value (if available)
320 * and always once with a value of NULL. 338 * and always once with a value of NULL.
321 * @param iter_cls closure for iter 339 * @param iter_cls closure for iter
340 * @return NULL if the entry was not queued, otherwise a handle that can be used to
341 * cancel; note that even if NULL is returned, the callback will be invoked
342 * (or rather, will already have been invoked)
322 */ 343 */
323void 344struct GNUNET_DATASTORE_QueueEntry *
324GNUNET_DATASTORE_get_random (struct GNUNET_DATASTORE_Handle *h, 345GNUNET_DATASTORE_get_random (struct GNUNET_DATASTORE_Handle *h,
325 unsigned int queue_priority, 346 unsigned int queue_priority,
326 unsigned int max_queue_size, 347 unsigned int max_queue_size,
@@ -328,6 +349,14 @@ GNUNET_DATASTORE_get_random (struct GNUNET_DATASTORE_Handle *h,
328 GNUNET_DATASTORE_Iterator iter, 349 GNUNET_DATASTORE_Iterator iter,
329 void *iter_cls); 350 void *iter_cls);
330 351
352/**
353 * Cancel a datastore operation. The final callback from the
354 * operation must not have been done yet.
355 *
356 * @param qe operation to cancel
357 */
358void
359GNUNET_DATASTORE_cancel (struct GNUNET_DATASTORE_QueueEntry *qe);
331 360
332 361
333#if 0 /* keep Emacsens' auto-indent happy */ 362#if 0 /* keep Emacsens' auto-indent happy */