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 Coroutines support for repository event handler #2427

Open
sbont opened this issue Nov 2, 2024 · 1 comment
Open

Add Coroutines support for repository event handler #2427

sbont opened this issue Nov 2, 2024 · 1 comment
Assignees
Labels
type: enhancement A general enhancement

Comments

@sbont
Copy link

sbont commented Nov 2, 2024

When implementing a repository event handler in Kotlin, marking it as suspend fun causes an IllegalArgumentAxception: "wrong number of arguments".
After some digging I found that a suspending function compiles to method expecting a kotlin.coroutines.Continuation as second parameter, and it seems to be unable to resolve this.

@Component
@RepositoryEventHandler(MyEntity::class)
class MyEntityEventHandler() {
    @HandleBeforeDelete
    suspend fun handleMyEntityDelete(value: MyEntity) {
//        logic
    }
}
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 2, 2024
@mp911de
Copy link
Member

mp911de commented Nov 4, 2024

@mp911de mp911de changed the title Repository event handler throws "wrong number of arguments" when using suspending function [Kotlin] Add Coroutines support for repository event handler Nov 4, 2024
@mp911de mp911de added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants