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 @BeforeRetry #1036

Merged
merged 1 commit into from
Jul 18, 2024
Merged

add @BeforeRetry #1036

merged 1 commit into from
Jul 18, 2024

Conversation

Ladicek
Copy link
Contributor

@Ladicek Ladicek commented Jul 16, 2024

Fixes #259

@Ladicek
Copy link
Contributor Author

Ladicek commented Jul 16, 2024

This is a draft, because tests are missing. Documentation probably also needs some improvement.

Publishing early to solicit feedback from @cescoffier and @geoand. I don't think you need to review everything, just look at the api module (especially the @BeforeRetry annotation). I'm especially interested in knowing whether these 2 aspects work for you:

  • the before retry method is always void and has no parameters
  • it must not block, it must be short and it must not throw

It would be possible to add parameters, similarly to how @Fallback works. It would probably also be possible to make it return CompletionStage<Void> (and other async types) so that async work is possible (in addition to void if async work is not necessary).

That's probably all.

@geoand
Copy link

geoand commented Jul 16, 2024

Nice!

I'll have a look soon

@Ladicek Ladicek force-pushed the before-retry-action branch from 8cd8aa1 to 5003287 Compare July 17, 2024 14:37
@Ladicek
Copy link
Contributor Author

Ladicek commented Jul 17, 2024

Added some tests. Documentation should still be improved.

@cescoffier
Copy link

LGTM,

We will likely automatically inject that annotation in Quarkus langchain4j.

@geoand
Copy link

geoand commented Jul 18, 2024

Lovely, we will certainly make use of it!

@Ladicek Ladicek force-pushed the before-retry-action branch from 5003287 to cd073db Compare July 18, 2024 12:17
@Ladicek Ladicek marked this pull request as ready for review July 18, 2024 12:17
@Ladicek
Copy link
Contributor Author

Ladicek commented Jul 18, 2024

OK, I take it the current API is good for you. I'll merge this and release. If it turns out the API is not sufficient, we can come back to it.

@Ladicek Ladicek added this to the 6.3.1 milestone Jul 18, 2024
@Ladicek Ladicek force-pushed the before-retry-action branch from cd073db to 8299f52 Compare July 18, 2024 12:38
@Ladicek Ladicek force-pushed the before-retry-action branch from 8299f52 to aeffffd Compare July 18, 2024 13:03
@Ladicek Ladicek merged commit 0e87a5e into smallrye:main Jul 18, 2024
12 of 13 checks passed
@Ladicek Ladicek deleted the before-retry-action branch July 18, 2024 13:33
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

Successfully merging this pull request may close these issues.

prototype "before retry action" support
3 participants