Skip to content

Add Coroutines support for repository event handler #2427

Open
@sbont

Description

@sbont

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
    }
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions