GithubHelp home page GithubHelp logo

person-service's Introduction

person-service

C++实现的一个grpc调用的简单示例
注:
客户端代码:
(1) person_manip.h
(2) person_client.cpp
服务端代码:
(1) person_manage.h
(2) person_server.cpp

编译上述代码依赖protobuf, grpc和folly库, 这些可以参考:
grpc安装: https://www.cnblogs.com/albizzia/p/10803032.html
folly库安装: https://www.cnblogs.com/albizzia/p/10824721.html
如果你不想使用folly库, 而且只有一个客户端单线程调用服务, 可以将folly库中的folly::ConcurrentHashMap替换成std::unordered_map,
然后移除CMakeLists中相关的target_link_libraries就可以了.

编译过程如下(在person-service文件夹):
$ mkdir build
$ cd build
$ cmake ..
$ make
其中生成的person-client和person-server分别是客户端和服务端, 使用./person-client和./person-server启动这两个应用就可以在person-client中 看到相关输出.

文档说明可以参考: https://www.cnblogs.com/albizzia/p/10830878.html

person-service's People

Contributors

ss-torres avatar

Watchers

James Cloos 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.