随笔 - 46  文章 - 0  评论 - 530  阅读 - 21万

MediatRPC - 基于MediatR和Quic通讯实现的RPC示例,新增Server Stream功能,发布开源地址。

大家好,我是失业在家,正在找工作的博主Jerry。今天发布MediatRPC的开源地址:github.com

文档增加了MediatRPC的架构图和架构说明(英文):

On the client side, it establishes a QUIC connection with the server side. The MediatR's standard methods like ''send/publish/createstream'' are implemented to open outbound bidirectional stream used to send and receive MediatR contract messages.
On the server side, it sets up a QuicListener to listen for client connections and accept the inbound stream when the client make the call after connected. It reads the request message from the stream and passes it to the MediatR handlers for processing, Then it writes the response message to the stream after processed.

通过MediatR的CreateSteam方法,我给MediatRPC增加了类似于GRPC的Server Stream功能,完整功能演示如下:

由于MediatR的CreateSteam方法只支持 IAsyncEnumerable<TResponse>,不支持IAsyncEnumerable<TRequest>,也就是说只能实现Server Stream,无法实现Clinet Stream 和 Bidirectional Stream。所以我给MediaR作者提了个Issue, Add support for IAsyncEnumerable<TRequest> · Issue #804 · jbogard/MediatR (github.com)

 

posted on   小庄  阅读(201)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· [AI/GPT/综述] AI Agent的设计模式综述
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示