Quantcast
Channel: Active questions tagged retry-logic - Stack Overflow
Viewing all articles
Browse latest Browse all 950

How to do retries in Kotlin, with timeout durations and maximum retry durations defined by arguments?

$
0
0

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?


Viewing all articles
Browse latest Browse all 950

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>