how do you use a waiter with https://github.com/cognitect-labs/aws-api? I.e. Iām starting a cluster and I want to block the thread until it is done starting?
I don't think this is fully intended to be used like this, but you can use the async version of the api's invoke along with :retriable to check if your thing is ready
(a/<!!
(aaws/invoke cfn
{:op <describe resources>
:request <request for resource info>
:retriable? (fn [result] <truthy when resource is ready>)
:backoff (fn [x]
(println "retry" (str "#" x))
(cond
(zero? x) 60000
(< x 20) 10000))}))yep that looks quite useful, I was just wondering what is the recommended way
You could always just do the polling manually in a normal loop also
Here's a bit more info why I don't think the :retriable thing is offically supported (I could be wrong) https://clojurians.slack.com/archives/C09N0H1RB/p1652101946639159
that's not what retriable is for
retriable is for failures, not stuff like status transitions from IN_PROGRESS -> READY
probably could use an issue for adding Waiters to aws-api