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

Add Asynchronous annotation when using Timeout #141

Open
Emily-Jiang opened this issue Jun 3, 2020 · 1 comment
Open

Add Asynchronous annotation when using Timeout #141

Emily-Jiang opened this issue Jun 3, 2020 · 1 comment
Assignees

Comments

@Emily-Jiang
Copy link
Member

In the following code sample,

@Retry(retryOn = TimeoutException.class,
           maxRetries = 4,
           maxDuration = 10,
           durationUnit = ChronoUnit.SECONDS,
           delay = 200, delayUnit = ChronoUnit.MILLIS)
    @Timeout(2000)
public Service showTransactions() throws Exception {
       Service transactions = new Transactions();
       transactions.getTransactions();
       return transactions;
   }

The above method should have Asynchronous annotation to make it the timeout within 2s instead of waiting for the method to return and then throw TimeoutException. Once adding that annotation, the return type needs to be CompletionStage<Service>.

@dmorgant
Copy link
Contributor

dmorgant commented Mar 3, 2021

I'm not sure it is within the scope of our interactive guide to make any changes here. It would require adding another annotation here, @asynchronous, which would involve adding to the content of the doc and would retract from the focus of the guide, which is on the @timeout and @Retry annotations.

Sent a note to Lavena on 2/11. Waiting for further discussion on changes for this guide.

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

2 participants