Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- suspend fun fetchImage(key: String, storage: Storage, imageFetcher: ImageFetcher) : Bitmap {
- val url = async {storage.getUrlForKey(key)}.await()
- val image = async { imageFetcher.getImageFromUrl(url) }
- println("this might be run after the async have started")
- return image.await()
- }
Add Comment
Please, Sign In to add comment