-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Support kotlin coroutines in quarkus-scheduler #21428
Comments
/cc @evanchooly, @mkouba |
@geoand 😃 |
Interesting idea! |
Hm, what's the point of turning a scheduled method into a coroutine? I mean it's not called directly from a user code and it's always executed on the main executor for blocking tasks. But I'm probably missing something here... |
I assume so users can use coroutine enabled APIs |
That's the point. With this change other suspend functions can be called directly. |
Ok, contributions are welcome. I have no idea what needs to be implemented ;-). |
I can take a look sometime after I get back, but it won't be high priority |
I'm not convinced the complexity is worth it. It's trivially simple to launch subsequent suspend functions via |
Has anything come of this? what's the problem with using |
runBlocking blocks the underlying thread. If i make for example an API call inside a scheduled method, the underlying thread is blocked as long as the API call takes. |
|
Do you mean GlobalScope.launch? This isn't a good option because of:
I've written some glue code using a custom coroutine scope but i think it would be best if Quarkus would manage the ApplicationCoroutineScope in the same manner as in resteasy reactive. |
This can definitely be done the proper way (like we have done in RESTEasy Reactive), but it's pretty low on our priority list... |
Support Kotlin suspend functions as scheduler methods
🎉 |
@geoand : When will this be released? Could it make it to 2.8.1? |
It will be part of Quarkus 2.9 |
Is there a planned release date for 2.9 already? 2.8 just came out and we cannot upgrade since 2.7.3 since we get into trouble with Hibernate Reactive... |
CR1 should be end of April if all goes well |
Can anyone tell me how to use |
Just annotate a public suspend function with |
@geoand thanks for your help. Can you provide me the actual package for |
Sorry, I meant |
I am using |
Yes |
Description
quarkus-scheduler
does not support suspend functions.In the past i bridged the gap with custom code, but i think it should be supported by quarkus.
I had this requirement multiple times.
Implementation ideas
No response
The text was updated successfully, but these errors were encountered: