Package-level declarations

Available in a dev version: 0․11․0-grpc-186

How to configure

Types

Link copied to clipboard

Properties

Link copied to clipboard
val GrpcServerKey: AttributeKey<GrpcServer>

Key used to store and retrieve the GrpcServer instance within the application's attributes.

Functions

Link copied to clipboard
fun Application.grpc(port: Int = environment.config.propertyOrNull(GrpcConfigKeys.grpcHostPortPath)?.getAs<Int>() ?: 8001, configure: GrpcServerConfiguration.() -> Unit = {}): GrpcServer

Configures and starts a gRPC server within the Ktor application. This function integrates with the Ktor lifecycle and manages the lifecycle of the gRPC server by subscribing to ApplicationStopping and ApplicationStopped events. It ensures that a gRPC server is properly initialized, started, and shutdown when the application stops.