Also, `api.getArtists()` is a suspending function ...
# getting-started
k
Also,
api.getArtists()
is a suspending function itself so I haven't quite figured out how to overcome that yet since
buildIterator
is not a suspending context
d
It depends, do you want it to be eager or lazy?
If you want it to be eager, I'd recommend not using
buildIterator
. Just build a list yourself.
If you want it to be lazy, I'd recommend a
producer
.
k
I'll look into
producer
, thanks!
@Dominaezzz is producer something implemented in the kotlin libraries that I'm not seeing, or are you talking about the producer-consumer pattern?
d
There's a
produce
function in the kotlinx.coroutines library.