Closed gukj-spel closed 1 month ago
此次更新主要集中在客户端管理的增强,增加了 go test
命令的超时设置,新增了一系列与客户端操作相关的命令类,同时重构了一些现有方法,引入了一个线程安全的客户端管理类。这些改动显著提升了系统的可维护性与扩展性。
文件路径 | 变更摘要 |
---|---|
.github/workflows/pikiwidb.yml | go test 命令添加了15分钟的超时时间。 |
src/base_cmd.h, src/cmd_admin.h | 引入了新的客户端管理命令类。 |
src/client.cc, src/client.h | 添加了新的客户端管理方法,并更新了现有方法的命名。 |
src/client_map.cc, src/client_map.h | 实现了 ClientMap 类,提供线程安全的客户端管理功能。 |
src/cmd_admin.cc | 实现了新命令类来处理各种客户端操作。 |
src/net/tcp_listener.cc | 更新了 TcpListener::OnNewConnection 中的操作顺序。 |
src/pikiwidb.cc, src/pikiwidb.h | 添加了新的客户端管理方法,并更新了客户端连接处理。 |
tests/admin_test.go | 为客户端操作添加了测试,验证功能和错误处理。 |
🐇 在代码的田野里,数据兔跳舞,
清晨的阳光下,新命令初露锋芒。
客户端管理如同画中的道路,
流畅得让每一个字节心驰神往。
共庆变化,在光辉中闪耀,
我们的代码,万世流芳。
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
add client command and corresponding go test CLIENT <GETNAME | SETNAME name | LIST [ID client_id1...client_idn] | KILL all | KILL ID client_id | KILL ADDR ip:port>
Summary by CodeRabbit
新功能
CmdClient
、CmdClientGetname
、CmdClientSetname
、CmdClientId
、CmdClientKill
、CmdClientList
,增强了命令处理功能。ClientMap
类以实现线程安全的客户端连接管理。PikiwiDB
类以更好地管理客户端连接。优化
TcpListener::OnNewConnection
中的操作顺序以优化连接处理。其他
go test
命令添加了15分钟的超时设置。