Andy Victors
01/29/2021, 10:28 AMktor
it does not manage async execution for me - the requests API is suspend
based. So I think I have two options:
A) Manage async execution by coroutines inside the common MPP code. From what I recall trying similar things a year ago, there are headaches configuring coroutine contexts for iOS and also some limitations (main thread only). So I am not sure if it all will work at all.
B) Or, I can put async logic into platform code. More code but ok. But still, will I be able to call suspend
marked methods from iOS?
I'd like to have thoughts on this topic from more experienced folks.Tijl
01/29/2021, 11:09 AMAndy Victors
01/29/2021, 11:14 AMsuspend
so I cannot use them for async calls without wrapping in coroutines or whatever.Tijl
01/29/2021, 11:19 AMAsynchronous
Scales as you need it. Using Kotlin coroutines, Ktor is truly asynchronous and highly scalable. Use the power of non-blocking development without the callback nightmare.am I understanding you right that you want to do something asynchronously but “without wrapping in coroutines or whatever.“?
Andy Victors
01/29/2021, 11:42 AMTijl
01/29/2021, 11:47 AMsuspend
method they will not to worry about those things.
but if you don’t want them to have to call a `suspend`ed method, you can do that for them, for example you can use Deffered and wrap the calls your method do to it in runBlocking
Andy Victors
01/29/2021, 11:57 AMTijl
01/29/2021, 11:59 AMKris Wong
01/29/2021, 1:40 PMrunBlocking
Michal Klimczak
01/29/2021, 4:22 PMAndy Victors
01/29/2021, 8:13 PMMichal Klimczak
01/29/2021, 8:24 PMKris Wong
01/29/2021, 8:28 PMMichal Klimczak
01/29/2021, 8:53 PMAndy Victors
01/29/2021, 8:55 PMMichal Klimczak
01/29/2021, 9:03 PMTijl
02/01/2021, 7:39 AM