tornadofx / tornadofx / Component / runAsync

runAsync

inline fun <reified T, R> KClass<T>.runAsync(noinline op: T.() -> R): Task<R> where T : Component, T : ScopedInstance

Perform the given operation on an ScopedInstance of the specified type asynchronousyly.

MyController::class.runAsync { functionOnMyController() } ui { processResultOnUiThread(it) }

inline fun <reified InjectableType, reified ReturnType> KFunction1<InjectableType, ReturnType>.runAsync(noinline doOnUi: (ReturnType) -> Unit = {}): Task<ReturnType> where InjectableType : Component, InjectableType : ScopedInstance

Perform the given operation on an ScopedInstance class function member asynchronousyly.

CustomerController::listContacts.runAsync(customerId) { processResultOnUiThread(it) }

inline fun <reified InjectableType, reified P1, reified ReturnType> KFunction2<InjectableType, P1, ReturnType>.runAsync(p1: P1, noinline doOnUi: (ReturnType) -> Unit = {}): <ERROR CLASS> where InjectableType : Component, InjectableType : ScopedInstance

Perform the given operation on an ScopedInstance class function member asynchronousyly.

CustomerController::listCustomers.runAsync { processResultOnUiThread(it) }

inline fun <reified InjectableType, reified P1, reified P2, reified ReturnType> KFunction3<InjectableType, P1, P2, ReturnType>.runAsync(p1: P1, p2: P2, noinline doOnUi: (ReturnType) -> Unit = {}): <ERROR CLASS> where InjectableType : Component, InjectableType : ScopedInstance
inline fun <reified InjectableType, reified P1, reified P2, reified P3, reified ReturnType> KFunction4<InjectableType, P1, P2, P3, ReturnType>.runAsync(p1: P1, p2: P2, p3: P3, noinline doOnUi: (ReturnType) -> Unit = {}): <ERROR CLASS> where InjectableType : Component, InjectableType : ScopedInstance
inline fun <reified InjectableType, reified P1, reified P2, reified P3, reified P4, reified ReturnType> KFunction5<InjectableType, P1, P2, P3, P4, ReturnType>.runAsync(p1: P1, p2: P2, p3: P3, p4: P4, noinline doOnUi: (ReturnType) -> Unit = {}): <ERROR CLASS> where InjectableType : Component, InjectableType : ScopedInstance
fun <T> runAsync(daemon: Boolean = false, status: TaskStatus? = find(scope), func: FXTask<*>.() -> T): Task<T>

fun <T> runAsync(status: TaskStatus? = find(scope), func: FXTask<*>.() -> T): Task<T>

Runs task in background. If not set directly, looks for TaskStatus instance in current scope.