Skip to content

Instantly share code, notes, and snippets.

View zhangkun83's full-sized avatar

Kun Zhang zhangkun83

  • Google
  • Mountain View, CA
View GitHub Profile
// Basically I want to initiate the stream from the client and then whenever I get a message from the server
// I want to respond immediately over the same stream.
private Future<Histogram> doStreamingCalls(Channel channel, final SimpleRequest request,
final long endTime) {
final TestServiceStub stub = TestServiceGrpc.newStub(channel);
final Histogram histogram = new Histogram(HISTOGRAM_MAX_VALUE, HISTOGRAM_PRECISION);
final HistogramFuture future = new HistogramFuture(histogram);
final StreamObserver<SimpleRequest> requestObserver;