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

Could I build the Retryer with different executors? #69

Open
ihaolin opened this issue Dec 31, 2016 · 3 comments
Open

Could I build the Retryer with different executors? #69

ihaolin opened this issue Dec 31, 2016 · 3 comments

Comments

@ihaolin
Copy link

ihaolin commented Dec 31, 2016

Hello,I want to build the retryer with different executors in my scene. The default executor is CachedThreadPool, but it's not fit.

Thanks & Regards

@JensRantil
Copy link

Hi @ihaolin,

Why not simply use the Retryer within the Runnable/Callable that you submit to the thread pool? Let me know if you'd like an example of what I'm talking about.

@qct
Copy link

qct commented Mar 22, 2017

@ihaolin

        ExecutorService retryExecutor = Executors.newSingleThreadExecutor();
        retryExecutor.submit(() -> {
            Callable<Void> myCallable = () -> {
                System.out.println("do something...");
                return null;
            };
            try {
                RetryerBuilder.<Void>newBuilder().build().call(myCallable);
            } catch (ExecutionException e) {
                e.printStackTrace();
            } catch (RetryException e) {
                e.printStackTrace();
            }
        });

@smartvolshell
Copy link

Hi, @qct I think @ihaolin his requirement is that only retry with different executors.
with your way, the normal call also in different executors.
but i also have no good idea to handle it .

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

4 participants