Types
Link copied to clipboard
object GrpcConfigKeys
Properties
Link copied to clipboard
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.