How to wait during http polling?

I’ve got an external service. You submit a request, and it replies with a URL you poll waiting for a response. Responses can take ~90 seconds to generate.

I’ve got a pair of macros setup, where the first hits the url, and calls the other on completion, and the second checks if the request is complete, and calls the first one if it’s not available yet. This works, but the next request starts immediately after the first finishes, which is rude and likely to get me rate limited. Does anyone have a good suggestion on how to introduce a delay into this recursive loop, so I can check for results say every 5 seconds or so?

Perhaps TiddlyTools/Time/action-timeout.js would be of use. For documentation, see TiddlyTools/Time/Info

enjoy,
-e

Wow, that looks perfect. I’m playing with it and I think that solves my exact problem. Thanks!

Hey Eric, would you mind if I repackaged that inside my own plugin, or cribbed from it to make something that I can package with my features?