Passing index to async while iterator