Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Write your own (async) RPC framework

Write your own (async) RPC framework

A simple asynchronous RPC framework in Go,
support message in JSON and protobuf format, and extendable.

Manh DV

June 24, 2019
Tweet

More Decks by Manh DV

Other Decks in Programming

Transcript

  1. Main points of a RPC framework - What remote procedure

    client wants to call/server contains? - What data schema that request / response use? - What transporter to delivery request / response? Client Server procedureCall(message) ResponseMessage(or not) 3
  2. Answers for REST and gRPC Questions / RPC fw REST

    gRPC What remote procedure? POST /action client.Action() What data schema? (Mostly) JSON Protobuf What transporter? HTTP/1.x or HTTP/2 Both HTTP/1.x and HTTP/2 4
  3. Write your own RPC framework - Simple version - What

    remote procedure? - client.Post(“/entry”, message) / server.Route() - What data schema? - JSON - What transporter? - HTTP/1.x 5
  4. Write your own RPC framework - A bit more complicated

    version - What remote procedure? - client.SendAsyncMsg() / service.RegisterXXXService() - What data schema? - - Protobuf or any custom format - What transporter? - - AWS SQS 6