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

Learn how Resilience4j implements the Retry mechanism #4

Merged
merged 9 commits into from
Apr 16, 2024

Conversation

franciscoengenheiro
Copy link
Member

@franciscoengenheiro franciscoengenheiro commented Apr 10, 2024

Resolves: kresil/kresil#6

@franciscoengenheiro franciscoengenheiro self-assigned this Apr 10, 2024
Copy link

@pmhsfelix pmhsfelix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need to clarify the different between a Retry and a RetryConfig


Register a `Retry` instance in the `RetryRegistry` with a configuration:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not clear what is the difference between a Retry and a RetryConfig.

Copy link
Member Author

@franciscoengenheiro franciscoengenheiro Apr 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RetryConfig represents the retry mechanism's behavior - policies - and is used to create a Retry instance. Retry is a thread-safe instance that holds the decoration logic and defines the async and sync contexts (i.e., state-holders), among other funcionalities (e.g., metrics, event-publishers).
A Retry instance cannot be created without a custom or default RetryConfig.

resilience4j/README.md Outdated Show resolved Hide resolved
resilience4j/README.md Outdated Show resolved Hide resolved
resilience4j/README.md Outdated Show resolved Hide resolved
> [!IMPORTANT]
> If Javascript target is required,
> a Kotlin Multiplatform implementation of the Retry mechanism cannot use synchronous [context](#context) because of the [single-threaded

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My current opinion is that the library should only support coroutine contexts, i.e., allow interception of suspend functions

@franciscoengenheiro franciscoengenheiro merged commit fdb673a into main Apr 16, 2024
1 check passed
@franciscoengenheiro franciscoengenheiro deleted the resilience4j-retry branch April 16, 2024 17:50
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.

Retry: check Resilience4j implementation and interoperability with Kotlin
2 participants