From f96375643fb13738357c456efde8e9b3f487ad2b Mon Sep 17 00:00:00 2001 From: Fabian Fritzsche Date: Wed, 25 May 2022 23:32:50 +0200 Subject: [PATCH] [DOCS] Kotlin: Add server.awaitTermination() call to starting server example (#972) --- content/en/docs/languages/kotlin/basics.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/content/en/docs/languages/kotlin/basics.md b/content/en/docs/languages/kotlin/basics.md index eded53c..d856b5e 100644 --- a/content/en/docs/languages/kotlin/basics.md +++ b/content/en/docs/languages/kotlin/basics.md @@ -312,8 +312,8 @@ fun main(args: Array) { val port = 8980 val server = RouteGuideServer(port) server.start() - /* ... */ -} + server.awaitTermination() + } ``` A server instance is built and started using a `ServerBuilder` as follows: @@ -324,6 +324,8 @@ A server instance is built and started using a `ServerBuilder` as follows: and pass it to the builder's `addService()` method. 1. Call `build()` and `start()` on the builder to create and start an RPC server for the route guide service. +1. Call `awaitTermination()` on the server to block the main function until + the application receives a signal to terminate. ### Creating the client {#client}