Is there a way to do a launch in K/N yet without u...
# kotlin-native
s
Is there a way to do a launch in K/N yet without using runBlocking? I need to perform async tasks without blocking the current thread, but just calling
GlobalScope.launch
for example throws an exception:
Copy code
IllegalStateException: There is no event loop. Use runBlocking { ... } to start one.
The problem is if I surround my launch with
runBlocking
, I am no longer performing an async task as it will block the calling thread until the launched coroutine completes.
b
This is basically what we made CoroutineWorker for. it'll be obsoleted by the native coroutines branch become part of the main releases. in the meantime you can use that or the native-mt (will have to search for the coroutines native PR to find the release tags I think) coroutines release
s
Do you know a rough expected timeline of when native coroutines will be merged in/officially supported?
b
Nope. I don't think anyone does except for probably this year
s
what is native-mt?
b
part of the branch name that has native support for multi-threaded coroutines
s
ah
great, thanks
looks like the branch is
1.3.3-native-mt
👍 2