Asynchronous API calls via image_read

I have a question similar to this: Asynchronous API calls with curl

Is there a way to do the similar process but with image_read. I have an Rmarkdown file that is pulling 16 images from an API and I'd like to be able to do them asynchronously rather than one by one.

image<- image_read(paste0("https://rconnect/etcetc/startDate=",startDate,

I'm essentially making an rmarkdown file that will be published as its own API, it calls various other APIs to create images. These images are plotted once called, so it's not an immediate image pull. Due to this, I'd like to be able to call all of them at the same time to decrease hang time of the rmarkdown file.

Nice! I would probably look at a few different areas:

  • the callr package for spawning subprocesses
  • the "Background Jobs" feature in the RStudio IDE (if this is being run in the IDE)
  • the future package for parallel computing
  • furrr perhaps? I think it does some parallelization

This isn't a use case I have tackled before. An example of your use case with a minimal reproducible example might be an interesting way to invite others to participate in solving the problem!!