Fixed running code async
This commit is contained in:
parent
cc9f142800
commit
b98bacd94a
|
@ -6,11 +6,7 @@ import BankingUiSwift
|
||||||
class DispatchQueueAsyncRunner : IAsyncRunner {
|
class DispatchQueueAsyncRunner : IAsyncRunner {
|
||||||
|
|
||||||
func runAsync(runnable: @escaping () -> Void) {
|
func runAsync(runnable: @escaping () -> Void) {
|
||||||
let frozen = FreezerKt.freeze(obj: runnable)
|
DispatchQueue.main.async { // we cannot run runnable on a background thread due to Kotlin Native's memory model (that objects dispatched to other threads have to be immutable)
|
||||||
|
|
||||||
runnable()
|
|
||||||
|
|
||||||
DispatchQueue(label: "DispatchQueueAsyncRunner", qos: .background).async {
|
|
||||||
runnable()
|
runnable()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue