GrpcCall

@JvmName(name = "grpcCall")
fun <S : Any, R : Any> GrpcCall(function: (S) -> R): GrpcCall<S, R>

Returns a new instance of GrpcCall that can be used for a single call to execute, executeBlocking, or enqueue.

The returned instance executes function synchronously on the calling thread, regardless of which blocking mode is used. If function throws, the thrown exception will be wrapped in an IOException.

This method is useful when implementing the interfaces that are generated by Wire:

override fun GetFeature(): GrpcCall<Point, Feature> {
return GrpcCall<Point, Feature> { request ->
return@GrpcCall lookupNearestFeature(request.latitude, request.longitude)
}
}

It is succinct when used in an expression function:

override fun GetFeature() = GrpcCall<Point, Feature> { request ->
return@GrpcCall lookupNearestFeature(request.latitude, request.longitude)
}