Git Product home page Git Product logo

hellogrpcstdin's Introduction

GRPC external plugin example

go get github.com/bithavoc/hellogrpcstdin

An example of GRPC Dialing with Stdin and Stdout of a child process.

greeter_server launches greeter_client as a process and uses os.Stdin and os.Stdout to listen for GRPC requests.

Note: You don't really need this library to implement GRPC plugins in Go, you can always use hashicorp/go-plugin which uses unix sockets.

Running Example

Compile Client(Plugin):

(cd greeter_client; go build)

Compile Server(Plugin):

(cd greeter_server; go build)

Run Server(Plugin):

(cd greeter_server; ./greeter_server)

You should see an output similar to this:

Server starting
accepting, waiting for only conn
agent process running, will ready listener
accepting, only conn ready
accepting, waiting for only conn
2018/07/16 19:13:33 Server replying, check greeter_server/client.log

cat greeter_server/client.log:

2018/07/16 19:15:51 client starting
2018/07/16 19:15:51 addresss 
2018/07/16 19:15:51 Greeting: Hello world from server

hellogrpcstdin's People

Contributors

bithavoc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

tphoney duxiaoguo

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.