Giter Club home page Giter Club logo

go-rpc's Introduction

go-rpc

go grpc micro study

protoc install

https://www.jianshu.com/p/00be93ed230c

protoc build

protoc --proto_path=proto --proto_path=third_party --go_out=plugins=grpc:proto service.proto

docker build

docker build --tag=go-rpc .

docker run

docker run -it -p 8081:8081 go-rpc

proto learn

https://www.jianshu.com/p/2265f56805fa
https://www.jianshu.com/p/774b38306c30
https://www.jianshu.com/p/85e9cfa16247

客户端 可以向 服务端 订阅 一个数据,服务端 就 可以利用 stream ,源源不断地 推送数据。

```
message User {  # type User struct
    string id = 1; # GetId() string
    string name = 2; # GetName() string
}

service Broadcast { # type BroadcastClient interface
    rpc CreateStream(Connect) returns (stream Message); 
    # CreateStream(ctx context.Context, in *Connect, opts ...grpc.CallOption) (Broadcast_CreateStreamClient, error)
    rpc BroadcastMessage(Message) returns (Close); 
    # BroadcastMessage(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Close, error)
}
```

go-rpc's People

Contributors

eilinge avatar

Watchers

 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.