简单ttl懒删除支持

This commit is contained in:
1iaan
2026-04-04 22:31:00 +08:00
parent 6ede44bd80
commit 78519fbfe5
11 changed files with 375 additions and 98 deletions

View File

@@ -30,6 +30,7 @@ typedef int (*msg_handler)(struct conn *conn);
static msg_handler kvs_handler;
extern iouring_ctx_t global_uring_ctx;
extern int ttl_delete_drain(int budget);
int kvs_request(struct conn *c) {
return kvs_handler ? kvs_handler(c) : -1;
@@ -603,6 +604,8 @@ int reactor_start(unsigned short port, msg_handler handler) {
conn_list[connfd].send_callback(connfd);
}
}
(void)ttl_delete_drain(8);
}
for (i = 0; i < listen_count; i++) {