大家好,我是失業在家,正在找工作的博主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)。