grpc / grpc/grpc-rust

Add support for in-memory-based protocols for no-IO easier client-server testing

Open
#1,407 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
12.5k
Forks
1.3k
Avg merge
4d 7h
Merged PRs (30d)
24

Description

## Feature Request

### Crates

- `tonic`?
- `tokio-stream`?

### Motivation

When testing `tonic` routes in CI at scale, it may be beneficial to use tonic over a protocol that can be implemented in-process and in-memory in the interest of testing time.

### Proposal

Implement a `TcpListener`-like struct that satisfies the constraints of `tonic::transport::Server::server_with_incoming()`:

```
stream: impl tokio_stream::Stream>,

...

where
IO: AsyncRead + AsyncWrite + Connected + Unpin + Send + 'static,
IO::ConnectInfo: Clone + Send + Sync + 'static,
IE: std::error::Error + Send + Sync + 'static,
```

### Alternatives

You could implement this in `tokio-stream` somehow maybe?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.