summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorZheng Chao <[email protected]>2023-07-24 03:24:31 +0800
committerZheng Chao <[email protected]>2023-07-24 03:24:31 +0800
commit49c33b4687c065ba2003a512aad67c24388b3d8e (patch)
tree305d54705a861f5b6f49783d77ae5e81b4af3b3c /include
parent27da04165b6e36d78dd2a4dfd2bb4962af919d6b (diff)
WIP: It works.
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 ce41260..285cef6 100644
--- a/include/swarmkv/swarmkv.h
+++ b/include/swarmkv/swarmkv.h
@@ -11,6 +11,8 @@
#pragma once
#include <stddef.h>
#include <stdio.h>
+#include <sys/time.h>
+
#ifdef __cplusplus
extern "C"
{
@@ -62,7 +64,8 @@ int swarmkv_options_set_consul_port(struct swarmkv_options *opts, unsigned int c
int swarmkv_options_set_consul_host(struct swarmkv_options *opts, const char* ip_addr);
int swarmkv_options_set_dryrun(struct swarmkv_options *opts);
int swarmkv_options_set_disable_run_for_leader(struct swarmkv_options *opts);
-int swarmkv_options_set_worker_thread_number(struct swarmkv_options *opts, size_t nr_worker_threads);
+int swarmkv_options_set_caller_thread_number(struct swarmkv_options *opts, int nr_caller_threads);
+int swarmkv_options_set_worker_thread_number(struct swarmkv_options *opts, int nr_worker_threads);
int swarmkv_options_set_cluster_announce_ip(struct swarmkv_options *opts, const char *ip_addr);
int swarmkv_options_set_cluster_announce_port(struct swarmkv_options *opts, unsigned int cluster_announce_port);
@@ -74,6 +77,11 @@ struct swarmkv;
struct swarmkv *swarmkv_open(struct swarmkv_options *opts, const char *cluster_name, char **err);
void swarmkv_close(struct swarmkv * db);
+
+void swarmkv_register_thread(struct swarmkv *db);
+void swarmkv_caller_loop(struct swarmkv *db, struct timeval *tv);
+void swarmkv_caller_loop_break(struct swarmkv *db);
+
//Blocking function
struct swarmkv_reply *swarmkv_command(struct swarmkv *db,const char *format, ...);
struct swarmkv_reply *swarmkv_command_on(struct swarmkv *db, const char *target, const char *format, ...);