Fork me on GitHub
Dimitar Uzunov09:06:55

how do you use a waiter with 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

  (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))
                     (zero? x) 60000
                     (< x 20)  10000))}))

šŸ‘ 1
Dimitar Uzunov13:06:05

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)

šŸ‘ 1

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