https://kotlinlang.org logo
#coroutines
Title
# coroutines
m

Marc Knaup

01/27/2019, 8:18 PM
Yeah, but I'd like to avoid making a whole JSON library suspend 😄 And try…finally will make the logic really complex because you cannot wrap a code into a lambda anymore and it will affect plenty of functions 😞
l

louiscad

01/27/2019, 10:11 PM
Are you writing this JSON library? If so, don't kotlinx.serialization or Moshi suit your needs?
m

Marc Knaup

01/27/2019, 10:28 PM
Yes, it's my own and it was there before Moshi and Kotlinx 🙂
l

louiscad

01/27/2019, 10:52 PM
Is it open source? If so, you could permalink a line of code here so I can see your particular case and give a more relevant answer
m

Marc Knaup

01/27/2019, 11:13 PM
The library is OSS (https://github.com/fluidsonic/fluid-json) but the use case is private code. Anyway I've worked around the issue by not using the affected lambda-accepting method since the
suspend
case was only in one occasion.
👍 1
well no, the use case is also OSS 🤔 anyway, nevermind 🙂
😅 1
l

louiscad

01/28/2019, 7:07 AM
Wow, you did a good job for the documentation!
m

Marc Knaup

01/28/2019, 10:05 AM
Thanks, on the other hand there is not a single KDoc comment yet 😅
3 Views