Closed nathanalderson closed 1 month ago
How are we feeling about this? Anything I can do to push it forward?
Periodic bump. Any feedback? Can we merge?
Works great, I'm using your branch @nathanalderson , thank you for this patch!
Thanks for merging!
This PR adds support for more flexible matching on the return value and raised exception for determining whether to retry. Instead of only supporting a list of atoms for each, you can now provide any of the following:
:not_okay
,SomeStruct
, orCustomError
). In this case, thedo
block will be retried in any of the following cases:{:not_okay, _}
):all
. In this case, all values/exceptions will be retried.fn val -> val.starts_with("ok") end
) or partial function (for example:fn {:error, %SomeStruct{reason: "busy"}} -> true
). The function will be called with the return value and thedo
block will be retried if the function returns a truthy value. If the function returns a falsy value or if no function clause matches, thedo
block will not be retried.do
block will be retried if any of the items in the list matches.This should address both #54 and #56.