Giter VIP home page Giter VIP logo

json-rpc-m1's Introduction

JSON-RPC M1

A remote procedure call framework written in Go programming language.

Yes, this is a framework, not a library, while it does not allow to automate the process of creation of an RPC infrastructure. Unfortunately, Go language does not fully support dynamic typing. It would be possible to automate the process of encoding and decoding of requests and responses, but it would need to use the "Reflection" feature of the language, which works about a hundred times slower than a normal code.

This framework helps in implementing an RPC server and RPC client using the JSON-RPC M1 protocol. More information about the JSON-RPC M1 protocol can be found in its repository: https://github.com/vault-thirteen/JSON-RPC-M1-Specification

Usage Example

A very simple usage example is available in the example\simple folder of this repository. A description and more information can be found there.

Features

The framework offers several features useful in practice.

  • Settings of this framework are configurable. For example, you can set your own HTTP client using TLS, etc.
  • The RPC server is able to catch and log exceptions (called "panic" in Go language).
  • The framework can count the requests.
  • The framework can measure time taken to perform function calls on the server side.
  • The framework allows user's function to see an ID of a request.
  • The framework allows to set additional meta information in request and response.
  • The framework uses a simple and robust protocol, which is focused on data safety and reliability.
  • The framework is very simple and does not require external tools.

As opposed to many other RPC protocols, this framework has some limits, which are the result of its simplicity.

  • One-side messages are forbidden.
    • Every request must be "acknowledged" with a response.
    • If you need an RPC for game servers, use the UDP protocol and do not cry when someone de-synchs.
  • Batch function calls are forbidden for safety reasons.
    • If you need to call for several functions, make several function calls.
  • The client makes one request at a time.
    • If you need to send spam to the server, use something else.
  • Error codes are not compatible with Google's JSON RPC and XML RPC protocols.
    • We are not Google.
  • This framework is not going to be as fast as GRPC with Protocol Buffers.
    • As with all the protocols using JSON format, textual format is always slower than a binary one.

json-rpc-m1's People

Contributors

vault-thirteen avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

deemount

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.