-1

The codebase I'm working with already has a way of defining retry limits through annotations, e.g.

@Retry(
    retryInterval = 60
)
fun doSomething(args: ...)

However the retry parameters need to be specified as function arguments, so the function caller can set them. I don't believe this is possible with annotations as the values must be set at compile time.

I need to retry while letting the function caller define the maximum retry interval (how long to retry for before timing out), and the retry interval (how frequently it is allowed to retry)

This is likely possible with while true and wait loops, but is there a more conventional method?

1 Answer 1

0

You will need to examine the source code of the annotation processor for @Retry. You will find that there are functions under there, and that the result of the @Retry is to wrap the written function in a call to the implementation -- which takes the parameters as ordinary parameters, just as you would like.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.