simbotApplication
fun <Config : ApplicationConfiguration, Builder : ApplicationBuilder<A>, A : Application> simbotApplication(factory: ApplicationFactory<Config, Builder, A>, configurator: Config.() -> Unit = {}, builder: suspend Builder.(Config) -> Unit = {}): ApplicationLauncher<A>(source)
构建一个 ApplicationLauncher.
e.g.
不进行配置:
val launcher: ApplicationLauncher<TarApplication> = simbotApplication(Tar)
val app: TarApplication = launcher.launch() // suspend launch
app.join() // suspend join
Content copied to clipboard
配置builder:
val launcher = createSimbotApplication(Foo) {
// build...
}
val app = launcher.launch() // suspend launch
app.join() // suspend join
Content copied to clipboard
配置config和builder:
val launcher createSimbotApplication(Bar, {
// config...
}) {
// build..
}
val app = launcher.launch() // suspend launch
app.join() // suspend join
Content copied to clipboard