<@U3ZLHBTLG> I’d recommend the following workaroun...
# coroutines
e
@louiscad I’d recommend the following workaround for your use-case in your fragment code:
Copy code
val mapAsync = async(context, CoroutineStart.LAZY) { ... your async code here to get the map ...  }
Then you’d use it like this
fragment.mapAsync.await()
. It is not as clean as property delegate, but works just as fine (100% lazy and remembers the value after initialization)
👍🏽 2
k
elizarov: is this operation atomic?
e
@kevinherron Which operation?
await
- yes. It will start this coroutine exactly once even if multiple concurrent
await
are invoked
k
Yes, that’s what I meant. Just ensuring the async block won’t run more than once if accessed concurrently the first time.