Package-level declarations

Types

Link copied to clipboard
interface GrpcCall<S : Any, R : Any>

A single call to a remote server. This call sends a single request value and receives a single response value. A gRPC call cannot be executed twice.

Link copied to clipboard
expect abstract class GrpcClient
actual abstract class GrpcClient
actual abstract class GrpcClient
Link copied to clipboard

A single streaming call to a remote server.

Link copied to clipboard
Link copied to clipboard
class GrpcException(val grpcStatus: GrpcStatus, val grpcMessage: String?, val grpcStatusDetails: ByteArray? = null, val url: String? = null) : IOException
Link copied to clipboard
expect class GrpcHeaders
actual typealias GrpcHeaders = Headers
typealias GrpcHeaders = Headers
actual class GrpcHeaders
Link copied to clipboard
expect class GrpcHttpUrl
actual typealias GrpcHttpUrl = HttpUrl
typealias GrpcHttpUrl = HttpUrl
actual class GrpcHttpUrl
Link copied to clipboard
class GrpcMethod<S : Any, R : Any>(val path: String, val requestAdapter: ProtoAdapter<S>, val responseAdapter: ProtoAdapter<R>)
Link copied to clipboard
expect class GrpcRequest
actual typealias GrpcRequest = Request
typealias GrpcRequest = Request
actual class GrpcRequest
Link copied to clipboard
expect abstract class GrpcRequestBody
actual typealias GrpcRequestBody = RequestBody
typealias GrpcRequestBody = RequestBody
actual abstract class GrpcRequestBody
Link copied to clipboard
expect open class GrpcRequestBuilder
actual typealias GrpcRequestBuilder = Request.Builder
typealias GrpcRequestBuilder = Request.Builder
actual open class GrpcRequestBuilder
Link copied to clipboard
expect abstract class GrpcResponseBody
actual typealias GrpcResponseBody = ResponseBody
typealias GrpcResponseBody = ResponseBody
actual abstract class GrpcResponseBody
Link copied to clipboard

A single streaming call to a remote server.

Link copied to clipboard
class GrpcStatus : Serializable
Link copied to clipboard
interface GrpcStreamingCall<S : Any, R : Any>

A single streaming call to a remote server. This class handles three streaming call types:

Link copied to clipboard
@ExperimentalCoroutinesApi
annotation class WireGrpcExperimental

Marker annotation for experimental Wire gRPC features.

Functions

Link copied to clipboard
inline suspend fun <S : Any, R : Any> GrpcStreamingCall<S, R>.bidirectionalStream(scope: CoroutineScope, crossinline block: suspend (SendChannel<S>, ReceiveChannel<R>) -> Unit): ReceiveChannel<R>

Executes a Bidirectional Streaming RPC call In this use case, you are free to interleave request and response messages. The caller can optionally send and receive messages in the supplied block or after the block completes in the returned ReceiveChannel.

Link copied to clipboard
inline fun <S : Any, R : Any> GrpcStreamingCall<S, R>.bidirectionalStreamBlocking(crossinline block: (MessageSink<S>, MessageSource<R>) -> Unit): MessageSource<R>

Executes a blocking Bidirectional Streaming RPC call In this use case, you are free to interleave request and response messages. The caller can optionally send and receive messages in the supplied block or after the block completes in the returned MessageSource.

Link copied to clipboard
inline suspend fun <S : Any, R : Any> GrpcClientStreamingCall<S, R>.clientStream(scope: CoroutineScope, crossinline block: suspend SendChannel<S>.() -> Unit): R

Executes a Client Streaming RPC call In this use case, all outbound request messages are sent before the inbound response message.

Link copied to clipboard
inline fun <S : Any, R : Any> GrpcClientStreamingCall<S, R>.clientStreamBlocking(crossinline block: MessageSink<S>.() -> Unit): R

Executes a blocking Client Streaming RPC call In this use case, all outbound request messages are sent before the inbound response message.

Link copied to clipboard
@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.

Link copied to clipboard
@JvmName(name = "grpcClientStreamingCall")
fun <S : Any, R : Any> GrpcClientStreamingCall(function: suspend ReceiveChannel<S>.() -> R): GrpcClientStreamingCall<S, R>
Link copied to clipboard
@JvmName(name = "grpcServerStreamingCall")
fun <S : Any, R : Any> GrpcServerStreamingCall(function: suspend SendChannel<R>.(S) -> Unit): GrpcServerStreamingCall<S, R>
Link copied to clipboard
@JvmName(name = "grpcStreamingCall")
fun <S : Any, R : Any> GrpcStreamingCall(function: suspend (ReceiveChannel<S>, SendChannel<R>) -> Unit): GrpcStreamingCall<S, R>

Returns a new instance of GrpcStreamingCall that can be used for a single call to executeIn or executeBlocking.

Link copied to clipboard