Git Product home page Git Product logo

yberpc's Introduction

yberpc

Erlang RPC 库。

API

start_server(Url, Handler)

启动 RPC 服务器。Url 为监听地址,Handler 为处理收到数据的进程 PID,返回值为一个 PID

start_client(Url, Handler)

启动 RPC 客户端。Url 为连接地址,Handler 为处理收到数据的进程 PID,返回值为一个 PID

rpc_req(Pid, ReqData)

请求 RPC 调用。PIDstart_client 返回的 PIDReqData 为请求数据。

rpc_rep(Pid, RepData)

响应 RPC 调用。PIDstart_server 返回的 PIDRepData 为响应数据。

stop_server(Pid)

停止 RPC 服务器。PIDstart_server 返回的 PID

stop_client(Pid)

停止 RPC 客户端。PIDstart_client 返回的 PID

Benchmark

测试环境:

  • OS: ubuntu 16.04 64-bit
  • CPU: Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz * 4
  • Memory: 12G
  • RPC 服务器和客户端都在此机器上

不同数据大小的 RPC 请求次数与耗时对应如下(ms 表示毫秒):

data: 1024 bytes:

count: 50000, time: 1753.242 ms
count: 100000, time: 3554.872 ms

data: 4096 bytes:

count: 50000, time: 1804.299 ms
count: 100000, time: 3692.052 ms

data: 16384 bytes:

count: 50000, time: 2003.51 ms
count: 100000, time: 3933.991 ms

yberpc's People

Contributors

shdxiang avatar

Watchers

James Cloos avatar David.Gao avatar  avatar

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.