Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to do this on something that is not a callable? #72

Open
mayooran99 opened this issue Jan 27, 2017 · 5 comments
Open

Is there a way to do this on something that is not a callable? #72

mayooran99 opened this issue Jan 27, 2017 · 5 comments

Comments

@mayooran99
Copy link

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.

@mayooran99 mayooran99 changed the title Is there a way to do this on something that is not callable? Is there a way to do this on something that is not a callable? Jan 27, 2017
@JensRantil
Copy link

You could at least use Callable<Void>.

@mayooran99
Copy link
Author

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.

@JensRantil
Copy link

JensRantil commented Jan 28, 2017

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.

@qct
Copy link

qct commented Mar 22, 2017

@JensRantil was right.

@mayooran99 you may find the default block strategy is ThreadSleepStrategy, it simply calls Thread.sleep()

@JensRantil
Copy link

If I've read the original issue description correctly, I believe this issue can be closed as a "non-issue".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants