Skip to content

Instantly share code, notes, and snippets.

View wakingrufus's full-sized avatar

John Burns wakingrufus

View GitHub Profile
@wakingrufus
wakingrufus / GrpcClient.kt
Created January 27, 2020 21:36
Grpc client call
import com.google.protobuf.GeneratedMessageV3
import io.grpc.Channel
import io.grpc.ManagedChannel
import io.grpc.ManagedChannelBuilder
import io.grpc.stub.AbstractStub
import io.grpc.stub.StreamObserver
import java.util.concurrent.CompletableFuture
fun <S : AbstractStub<S>, I, R : GeneratedMessageV3> grpcCall(stub: S, call: S.(I, StreamObserver<R>) -> Unit): (I) -> CompletableFuture<R> {
return { input ->

Keybase proof

I hereby claim:

  • I am wakingrufus on github.
  • I am wakingrufus (https://keybase.io/wakingrufus) on keybase.
  • I have a public key ASA4zDc-o9OdFSStwmxKtdWyAF4IDQNPRr4RrARPB2Mrdgo

To claim this, I am signing this object: