38 incorrectly throwing exception when interacting on same thread.
Appears coroutines appends "@coroutine#n" to the thread name, and this can change when suspending/resuming coroutines. The solution provided in this PR strips the coroutine name from the threadname. A test that fails without stripping the suffix has been added in ThreadUtilSpec.
38 incorrectly throwing exception when interacting on same thread.
Appears coroutines appends "@coroutine#n" to the thread name, and this can change when suspending/resuming coroutines. The solution provided in this PR strips the coroutine name from the threadname. A test that fails without stripping the suffix has been added in
ThreadUtilSpec
.Long term, handling of same thread enforcement may change - perhaps wrapping store in channel or actor. For now this should work, however all interactions with the store will need to be from a singleThreadCoroutine context, such as one with
Dispatchers.Main
or for native - https://github.com/reduxkotlin/ReadingListSampleApp/blob/master/common/src/iosMain/kotlin/org/reduxkotlin/readinglist/common/UI.kt @jennymolske