Is calling Ktor in background thread possible at all ATM? We lost all hope to do that on iOS.
🚫 3
k
kpgalligan
04/15/2020, 12:38 AM
To be clear, if you call it on the main thread, the call suspends and does the actual network call on a background thread. Just FYI. It doesn’t actually do the network call on the main thread.
a
antrax
04/15/2020, 12:42 AM
I understand. The issue is that we want to trigger network operation (it's sync data operation) from background thread (in Android service). So I can't switch to main thread (get illegal attempt to access non-shared $dispatch$lambda-0$FUNCTION_REFERENCE$42@85961ee8 from other thread) nor call Ktor in the background thread.
k
kpgalligan
04/15/2020, 12:44 AM
Yeah, got it. I’m currently wrestling with ktor/ios issues myself, so if there’s a vote for improving support, I’m a +1
a
antrax
04/15/2020, 12:48 AM
I see, just wanted to confirm I didn't miss some magic how to workaround that. Sounds like we have to switch to platform impl on iOS for background part.