-
Notifications
You must be signed in to change notification settings - Fork 9
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
@EventHandler
does not support kotlin coroutine
#20
Comments
So, I am assuming the request you are having is to provide support for coroutine function in Kotlin, correct @UkonnRa? Although the statement is clear, speaking out the desired approach would be beneficial too. No worries for now by the way, just for future reference. At the moment, I am not a 100% sure whether this would be a Kotlin-Extension issue only, as this imposes some requirements from event handling function for anybody. Due to the unclarity at this stage, I have marked the issue as "Under Discussion". Added, the priority is "Could" for the time being. As soon as we start taking off on it, we will make sure to update the ticket accordingly. |
Well, now axon does support the return type |
I can ascertain you we are looking into those options as well. :-) We need to find the right place and time for this first though, of course. |
@smcvb what is the state of coroutine support within the Axon Framework? I don't think I can use |
@jnfeinstein at the moment this issue does not have any major priority given all the other topics we are working on. Additionally, I don't have any personal experience with trying out coroutines within Aggregates, Sagas, etc, thus would be unable to share any info on this. Maybe @sandjelkovic has performed some trails on the matter? |
Well, multi-threaded or asynchronous calls in general, coroutine or not. |
For coroutines, @jnfeinstein you are correct that you have to run them inside a Basically, once you return from your Event handler method, it is considered that the event has been handled. That is why you need to run and complete or cancel all your coroutines while inside your method block/expression. |
@UkonnRa and @jnfeinstein if still interested in a more elegant solution, you could give https://github.com/AxonFramework/extension-kotlin/tree/coroutines_module/kotlin-coroutine a try. It's not working with annotations yet, but that could be added. It does make the event handling async, and decoupled from updating the tracking tokens. |
Axon version
4.3
Example
Result
The text was updated successfully, but these errors were encountered: