Reduks
Reduks copied to clipboard
How do I configure threading
Can I configure .subscribe to be only exectued on a specific thread?
Hi, Yes you can. Currently your options are using KovenantStore or RxStore, which by default will always run the subscriber notifications on the Android UI thread, but you can easily modify it. What is your use case?
What is your use case?
I've been thinking about using this library for my JavaFX global shared state.
So you need to subscribe for updates on JavaFX Ui thread?
I have some experimental coroutine based asynchronous store that would probably be easiest to modify for your use case. Using coroutine based code (still experimental in kotlin) is an option for you?
@beyondeye
So you need to subscribe for updates on JavaFX Ui thread?
yes, exactly
Using coroutine based code (still experimental in kotlin) is an option for you?
I don't mind.
Ok, so use 3.0.0b1 release and use AsyncStore.
add dependency from kotlinx-coroutines-javafx
compile "org.jetbrains.kotlinx:kotlinx-coroutines-javafx:<kotlin_coroutines_version>"
Currently I am using <kotlin_coroutines_version>=0.16
use
subscribeContext=JavaFx
as argument for AsyncStore constructor.
Take a look also to Guide to UI programming with coroutines for more details
don't close this issue. Let us keep it up for reference