github.com/matrixorigin/matrixone@v1.2.0/pkg/common/morpc/README.md (about) 1 # morpc 2 The morpc is a [Goetty](https://github.com/fagongzi/goetty) wrapper based message communication framework. Based on morpc, you can implement `Request-Response`, `Stream` two types of communication. 3 4 ## Components 5 morpc consists of `RPCClient` and `RPCServer`. RPCClient is used to send messages and RPCServer is used to process and respond to request messages. 6 7 ### RPCClient 8 An RPCClient can manage multiple underlying tcp connections, which we call `Backend`. Each `Backend` will start two gortoutines to handle the IO reads and writes. A server address can correspond to more than one Backend, and load balancing by way of RoundRobin. 9 10 ### RPCServer 11 RPCServer can listen to a TCP address or a UnixSocket.After a client connects, the RPCServer allocates two co-processes to handle the IO reads and writes.When RPCServer is started, it will set a message processing `Handler`, which will be invoked whenever a message is received from a client, and the specific logic of message processing needs to be implemented in the `Handler`. 12 13 ## Examples 14 * [Request-Response](./examples/pingpong/main.go) 15 * [Stream](./examples/stream/main.go) 16 17