How do I iterate using an async function?

I’m currently calling Iter.iterate() and the function that I’m inserting as an argument into Iter.iterate() is an async function. I’m getting the error below because apparently, you can’t iterate using an async function. is there any reason for this limitation? or was the case in which iterating using an async simply forgotten?

I think it probably was because it’s not clear what to do with a future returned a callback. Do you await it, or move on? That’s probably more of the domain of a separate futures library, similar to a JavaScript Promise.all or something. Just a guess.

That sounds plausible. I was able to work around it by converting the iter to an array, then looping over the array in a while loop. inside the loop was the async function, and it worked.