Skip to content

Commit

Permalink
doc: update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MiaoHN committed Feb 14, 2025
1 parent 3503b9c commit e26d93e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
30 changes: 24 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
# TiRPC - Tiny RPC Framework

多线程多协程轻量 RPC 框架
![tirpc](https://img.shields.io/github/v/release/MiaoHN/tirpc?color=2&label=tirpc&logoColor=2&style=plastic) ![GitHub repo size](https://img.shields.io/github/repo-size/MiaoHN/tirpc?style=plastic) ![GitHub last commit](https://img.shields.io/github/last-commit/MiaoHN/tirpc)

## Examples
参考 [Gooddbird/tinyrpc](https://github.com/Gooddbird/tinyrpc) 实现的轻量级多线程多协程 RPC 框架,有关核心代码的原理请参阅[原作者文章](https://www.zhihu.com/column/c_1515880656429510656)

### RPC Service
## 特色功能

- 更好看的 Banner 输出,提示服务器正常运行
- 仿照 SpringBoot 的日志输出格式,日志内容更易理解
- 改正日志重复输出的 bug
- 正确处理 `TcpConnection``read_hook` 为空的逻辑
- 使用从 `TcpServer` 继承的方式区分 RPC 服务器和 HTTP 服务器,解耦代码
- 完善 `HttpServer`,目前支持通过 GET 请求从服务器正确读取多种文本文件

## 待办列表

- [ ] 支持新的 RPC 协议,比如 json(参考 [jrpc](https://github.com/guangqianpeng/jrpc)
- [ ] 实现基于 Raft 的分布式治理框架(参考 [ACID](https://github.com/zavier-wong/acid/tree/main)

## 使用示例

示例代码请见文件夹 `./examples`

### RPC 服务调用

![rpc_service](https://cdn.jsdelivr.net/gh/MiaoHN/image-host@master/images/202502142213545.png)

### Http Server
### HTTP 服务器

![http_server](https://cdn.jsdelivr.net/gh/MiaoHN/image-host@master/images/202502142240987.png)

## Benchmark
## 性能测试

### 测试环境

Expand All @@ -32,7 +50,7 @@ wrk -c 1000 -t 8 -d 30 --latency 'http://127.0.0.1:19999/qps?id=1'
| 4 | 38781.26 | 36080.29 | 37408.68 | 36920.82 |
| 16 | 72882.96 | 63116.69 | 64311.55 | 75873.56 |

## Reference
## 参考资料

- [libco](https://github.com/Tencent/libco)
- [tinyrpc](https://github.com/Gooddbird/tinyrpc)
Expand Down
2 changes: 1 addition & 1 deletion tirpc/common/start.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static void ShowBanner() {
for (const auto &line : tirpc_banner) {
std::cout << line << std::endl;
}
std::cout << " :: TiRPC :: (v0.1.0.DEVELOP)\n" << std::endl;
std::cout << " :: TiRPC :: (v1.0.0.RELEASE)\n" << std::endl;
}

void StartServer(TcpServer::ptr server) {
Expand Down

0 comments on commit e26d93e

Please sign in to comment.