server
Ktor ApplicationEngine as a Resource. This Resource will gracefully shut down the server When we need to shut down a Ktor service we need to properly take into account a grace period where we still handle requests instead of immediately cancelling any in-flight requests.
Parameters
Application engine for processing the requests
Server listening port. Default is set to 80
Host address. Default is set to "0.0.0.0"
specifies path substrings that will be watched for automatic reloading
preWait a duration to wait before beginning the stop process. During this time, requests will continue to be accepted. This setting is useful to allow time for the container to be removed from the load balancer. This is disabled when io.ktor.development=true
.
grace a duration during which already inflight requests are allowed to continue before the shutdown process begins.
timeout a duration after which the server will be forcibly shutdown.
Represents configured and running web application, capable of handling requests.
Ktor ApplicationEngine as a Resource. This Resource will gracefully shut down the server When we need to shut down a Ktor service we need to properly take into account a grace period where we still handle requests instead of immediately cancelling any in-flight requests.
Parameters
Application engine for processing the requests
definition of the core configuration of the server, including modules, paths, and environment details.
preWait a duration to wait before beginning the stop process. During this time, requests will continue to be accepted. This setting is useful to allow time for the container to be removed from the load balancer. This is disabled when io.ktor.development=true
.
grace a duration during which already inflight requests are allowed to continue before the shutdown process begins.
timeout a duration after which the server will be forcibly shutdown.