介绍

SearpcSeafile项目中基于GObject系统的一个简单的C语言RPC框架,当然为了使其Web框架Seahub通配,所以也支持了python语言。

github地址: https://github.com/haiwen/libsearpc

框架目录

➜  libsearpc git:(master) ✗ tree -L 1
.
├── AUTHORS
├── ChangeLog
├── INSTALL
├── LICENSE.txt
├── Makefile.am
├── NEWS
├── README.markdown
├── autogen.sh
├── configure.ac
├── debian
├── demo
├── lib
├── libsearpc.pc.in
├── libsearpc.sln
├── libsearpc.vcxproj
├── m4
├── po
├── pysearpc
└── tests

PRC功能在lib目录下基于C语言实现,在pysearpc目录下基于python语言实现。 且其基于C语言和基于python语言的实现是一一对应的。

lib

lib目录:

➜  lib git:(master) ✗ tree -L 1
.
├── Makefile.am
├── searpc-client.c
├── searpc-client.h
├── searpc-codegen.py
├── searpc-named-pipe-transport.c
├── searpc-named-pipe-transport.h
├── searpc-server.c
├── searpc-server.h
├── searpc-utils.c
├── searpc-utils.h
└── searpc.h

pysearpc

pysearpc目录:

➜  pysearpc git:(master) ✗ tree -L 1
.
├── Makefile.am
├── __init__.py
├── client.py
├── common.py
├── errors.py
├── named_pipe.py
├── pygencode.py
├── server.py
├── test_pysearpc.py
├── transport.py
└── utils.py

librpc同样实现了一般rpc应具有的功能,例如通讯,服务注册,远程接口注册,数据序列化等。后面会对照着代码看这些功能具体是怎么实现的。

Copyright © itrunner.cn 2020 all right reserved,powered by Gitbook该文章修订时间: 2022-08-28 07:44:16

results matching ""

    No results matching ""