guava-retrying
guava-retrying copied to clipboard
Is there a way to do this on something that is not a callable?
I have this requirement where I have around 4 methods all of which need to retry of certain exception. But since the execution sequence of these methods is specified, they cannot be retried on separate callables. Is there a solution for this problem through this library? That is retry methods and not callables.
You could at least use Callable<Void>.
but that would still execute everything on a separate thread right? I mean each and every method which need this retry mechanism? Because all of them have to run in the same thread.
but that would still execute everything on a separate thread right?
No. Using a Callable<?> (or Runnable for that matter) doesn't mean it's run as a new thread. They are simple interfaces just like any other interface in Java. Also, the Retryer is running in the same thread as the caller.
@JensRantil was right.
@mayooran99 you may find the default block strategy is ThreadSleepStrategy, it simply calls Thread.sleep()
If I've read the original issue description correctly, I believe this issue can be closed as a "non-issue".