summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorZheng Chao <[email protected]>2023-08-09 00:35:19 +0800
committerZheng Chao <[email protected]>2023-08-09 00:35:19 +0800
commite8214a0677509e332fabfa2832428102ffd0cda0 (patch)
tree87c0cc384dcefa88d024a60cc422ddc967a9f4e8 /include
parentec53024020bc90e38a5dc67b660508fba86e7307 (diff)
`swarmkv_cli` works again.
Diffstat (limited to 'include')
-rw-r--r--include/swarmkv/swarmkv.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/swarmkv/swarmkv.h b/include/swarmkv/swarmkv.h
index 072485f..2bf3036 100644
--- a/include/swarmkv/swarmkv.h
+++ b/include/swarmkv/swarmkv.h
@@ -80,7 +80,15 @@ void swarmkv_close(struct swarmkv * db);
void swarmkv_register_thread(struct swarmkv *db);
-void swarmkv_caller_loop(struct swarmkv *db, struct timeval *tv);
+
+//Do not exit the loop because we have no pending events.
+#define SWARMKV_LOOP_NO_EXIT_ON_EMPTY 0x04
+//Do not block: see which events are ready now, run the callbacks of the highest-priority ones, then exit.
+#define SWARMKV_LOOP_NONBLOCK 0x02
+// Block until we have an active event, then exit once all active events have had their callbacks run.
+#define SWARMKV_LOOP_ONCE 0x01
+//flags any combination of SWARMKV_LOOP_ONCE | SWARMKV_LOOP_NONBLOCK | SWARMKV_LOOP_NO_EXIT_ON_EMPTY
+void swarmkv_caller_loop(struct swarmkv *db, int flags, struct timeval *tv);
void swarmkv_caller_loop_break(struct swarmkv *db);
//Blocking function