Giter Club home page Giter Club logo

grpc-rust's Introduction

grpc-rust

Build Status License crates.io

Rust implementation of gRPC protocol, under development.

Some development questions in FAQ.

Current status

It basically works. See grpc-examples/src/bin/greeter_{client,server}.rs. It can be tested for example with go client:

# start greeter server implemented in rust
$ cargo run --bin greeter_server

# ... or start greeter server implemented in go
$ go get -u google.golang.org/grpc/examples/helloworld/greeter_client
$ greeter_server

# start greeter client implemented in rust
$ cargo run --bin greeter_client rust
> message: "Hello rust"

# ... or start greeter client implemented in go
$ go get -u google.golang.org/grpc/examples/helloworld/greeter_client
$ greeter_client rust
> 2016/08/19 05:44:45 Greeting: Hello rust

Client and server are implemented asynchronously.

How to generate rust code

There are two ways to generate rust code from .proto files

Invoke protoc programmatically with protoc-rust-grpc crate

(Recommended)

Have a look at readme in protoc-rust-grpc crate.

With protoc command and protoc-gen-rust-grpc plugin

Readme

Use generated protos in your project:

In Cargo.toml:

[dependencies]
grpc            = "~0.5"
protobuf        = "~2"
futures         = "~0.1"
futures-cpupool = "~0.1"

In lib.rs or main.rs (or any other submodule):

extern crate protobuf;
extern crate grpc;
extern crate futures;
extern crate futures_cpupool;

pub mod myproto;
pub mod myproto_grpc;

TODO

  • Fix performance
  • More tests
  • In particular, add more compatibility tests, they live in interop directory
  • Fix all TODO in sources

Related projects

  • grpc-rs — alternative implementation of gRPC in Rust, a wrapper to C++ implementation
  • httpbis — implementation of HTTP/2, which is used by this implementation of gRPC
  • rust-protobuf — implementation of Google Protocol Buffers

grpc-rust's People

Contributors

stepancheg avatar overvenus avatar bblancha avatar aptakhin avatar andreasdotorg avatar weiznich avatar disksing avatar siddontang avatar thedodd avatar przygienda avatar coocoocacha avatar erickt avatar hectorj avatar busyjay avatar kkimdev avatar mehcode avatar skadge avatar vrusinov avatar yonran avatar dyxushuai 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.