Are there some property delegates for computing so...
# getting-started
m
Are there some property delegates for computing something expensive, preferably using suspending fun?
m
Is 'lazy' what you're looking for? Computes value once on first usage. See built in delegates in docs. I'm afk or I'd provide direct link.
m
Something thread-safe like
lazy
but actually eager
Considering it's expensive to compute, I'd like to preload it before anyone needs it and avoid blocking clients
c
a suspended delegate doesn’t really make sense. Property access is synchronous, suspense is not. You’d have to block the property access to run a suspending calculation in the getter. Access to that property should be put behind a suspending getter-type function, and clients just need to manage the coroutine themselves
m
makes sense