Skip to content

jjz/grpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# gRPC Rust Service Example

This is a gRPC service example project implemented using Rust and tonic. This project demonstrates how to create a simple gRPC server with both synchronous and streaming responses.

## Features

- gRPC service implementation based on the tonic framework
- Support for regular RPC calls (SayHello)
- Support for server streaming RPC calls (SayHelloStream)
- Service interface defined using Protocol Buffers
- Includes client example code

## Quick Start

### Build the Project

```
cargo build
```

### Run the Server

```
cargo run --bin server
```

The server will start on 127.0.0.1:50051.

### Run the Client Example

```
cargo run --bin client
```

## Service Interface

The service implements two methods:
- **SayHello** - Receives a request and returns a greeting message
- **SayHelloStream** - Receives a request and returns a stream of greeting messages (one message per second, 5 messages in total)

## Technology Stack

- Rust
- tonic - gRPC implementation for Rust
- tokio - Asynchronous runtime
- Protocol Buffers - Interface definition language

## License

MIT



About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages