EmbeddedServer
expect class EmbeddedServer<TEngine : ApplicationEngine, TConfiguration : ApplicationEngine.Configuration>(rootConfig: ServerConfig, engineFactory: ApplicationEngineFactory<TEngine, TConfiguration>, engineConfigBlock: TConfiguration.() -> Unit = {})
Represents an embedded server that hosts an application. It's an entry point to the application and handles the lifecycle of the application engine.
Parameters
TEngine
The type of the application engine used by the server.
TConfiguration
The type of the configuration used by the engine.
actual class EmbeddedServer<TEngine : ApplicationEngine, TConfiguration : ApplicationEngine.Configuration>(rootConfig: ServerConfig, engineFactory: ApplicationEngineFactory<TEngine, TConfiguration>, engineConfigBlock: TConfiguration.() -> Unit)
actual class EmbeddedServer<TEngine : ApplicationEngine, TConfiguration : ApplicationEngine.Configuration>
actual class EmbeddedServer<TEngine : ApplicationEngine, TConfiguration : ApplicationEngine.Configuration>(rootConfig: ServerConfig, engineFactory: ApplicationEngineFactory<TEngine, TConfiguration>, engineConfigBlock: TConfiguration.() -> Unit)
Constructors
Link copied to clipboard
expect constructor(rootConfig: ServerConfig, engineFactory: ApplicationEngineFactory<TEngine, TConfiguration>, engineConfigBlock: TConfiguration.() -> Unit = {})
actual constructor(rootConfig: ServerConfig, engineFactory: ApplicationEngineFactory<TEngine, TConfiguration>, engineConfigBlock: TConfiguration.() -> Unit)
actual constructor(rootConfig: ServerConfig, engineFactory: ApplicationEngineFactory<TEngine, TConfiguration>, engineConfigBlock: TConfiguration.() -> Unit)
Functions
Link copied to clipboard
Adds automatic application shutdown hooks management. Should be used before starting the server. Once application termination noticed, stop block will be executed. Please note that a shutdown hook only registered when the application is running. If the application is already stopped then there will be no hook and no stop function invocation possible. So stop block will be called once or never.
Link copied to clipboard
Link copied to clipboard