Is there a Worker-equivalent API available in nati...
# kotlin-native
b
Is there a Worker-equivalent API available in native for main thread execution? Something that'd like me execute a block on the main thread, which I could run from a background worker?
r
Yep, it's even called
Worker
. You should freeze (make immutable) everything that crosses thread boundary though.
b
That's what I mean. I don't see a Worker.main
oh whoops i left out part of my question. fixed! should make more sense now
r
You mean some ready-made abstraction around main-thread event loop? None to my knowledge.
b
yep that basically
okay thanks
o
Main thread event queue is very platform/toolkit-specific, so we do not have this abstraction in standard library.
👍 1
g
It is, but what about Main thread event queue for iOS?
b
Yep I can lean on that. Was hoping to have one that could be shared within native. kotlinx.coroutines has ThreadLocalEventLoop, but it's internal