diff options
| author | Zheng Chao <[email protected]> | 2023-08-09 00:35:19 +0800 |
|---|---|---|
| committer | Zheng Chao <[email protected]> | 2023-08-09 00:35:19 +0800 |
| commit | e8214a0677509e332fabfa2832428102ffd0cda0 (patch) | |
| tree | 87c0cc384dcefa88d024a60cc422ddc967a9f4e8 /include | |
| parent | ec53024020bc90e38a5dc67b660508fba86e7307 (diff) | |
`swarmkv_cli` works again.
Diffstat (limited to 'include')
| -rw-r--r-- | include/swarmkv/swarmkv.h | 10 |
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 |
