GrpcDsl

object GrpcDsl

DSL entry point for building gRPC channels, servers, attributes, and stream observers.

Supports both Netty-based (network) and in-process transports, with optional TLS and retry configuration.

Types

Link copied to clipboard
class StreamObserverHelper<T> : StreamObserver<T>

A DSL-friendly StreamObserver implementation that delegates to user-supplied lambda callbacks.

Functions

Link copied to clipboard
fun attributes(block: Attributes.Builder.() -> Unit): Attributes

Builds gRPC Attributes using a DSL-style configuration block.

Link copied to clipboard
fun channel(hostName: String = "", port: Int = -1, enableRetry: Boolean = false, maxRetryAttempts: Int = 5, tlsContext: TlsContext, overrideAuthority: String = "", inProcessServerName: String = "", block: ManagedChannelBuilder<*>.() -> Unit): ManagedChannel

Builds a ManagedChannel using either a Netty transport or an in-process transport.

Link copied to clipboard
fun server(port: Int = -1, tlsContext: TlsContext = PLAINTEXT_CONTEXT, inProcessServerName: String = "", block: ServerBuilder<*>.() -> Unit): Server

Builds a gRPC Server using either a Netty transport or an in-process transport.

Link copied to clipboard

Creates a StreamObserver using a DSL-style builder.