F0X12/27/2020, 12:26 PM
that simply runs the coroutines on an existing main thread?
dispatcher to use one existing, plain java thread. I am not working in an environment where this already exists, like Android, Swing or JavaFX
does not exist without someone registering the appropriate service, which is what I want to do. Because I am integrating this code into an existing Program as a kind of "Plugin" I want to create a simple Dispatcher that runs all coroutines on this single existing thread.
Chrimaeon12/27/2020, 1:31 PM
Dominaezzz12/27/2020, 1:44 PM
which creates a dispatcher on the calling thread for the coroutines to run. If you're looking to create a dispatcher object, I think that can be done in a useful way since the dispatcher has to take control of the thread by blocking it.
F0X12/27/2020, 3:06 PM
for running things on the main thread, so I could just do as @Chrimaeon suggested and delegate to this. Even though it seems a bit hacky using this "InternalCoroutinesApi" to set
myself everything is working fine so far. Thank you all for helping out!