-
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 suspend functions as scheduler methods #24741
Conversation
This is still in draft because I need to add some test and potentially clean up the code a bit. |
12fd210
to
c26a651
Compare
Hm, can't |
It can, but that means that users will have to pull it in explicitly. |
c62e382
to
1f4a028
Compare
I see. What magic does include the relevant extensions? ;-) |
In this case there is no magic, it's just that We have used the same exact strategy in Kotlin support for Reactive Messaging. In that case we didn't need to introduce these |
Couldn't we just add the optional dependencies on Kotlin to |
Not stupid at all! We certainly could, but then that would end up creating problems for anyone wanting to work on |
Makes sense. |
PR updated to fix a conflict |
And now another one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good but it would be great if some kotlin expert could review the kotlin parts. CC @evanchooly
...s/scheduler/deployment/src/main/java/io/quarkus/scheduler/deployment/SchedulerProcessor.java
Outdated
Show resolved
Hide resolved
@@ -553,4 +601,17 @@ UnremovableBeanBuildItem unremoveableSkipPredicates() { | |||
return new UnremovableBeanBuildItem(new UnremovableBeanBuildItem.BeanTypeExclusion(SchedulerDotNames.SKIP_PREDICATE)); | |||
} | |||
|
|||
@BuildStep | |||
void produceCoroutineScope(BuildProducer<AdditionalBeanBuildItem> buildItemBuildProducer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the kotlin extension should produce a io.quarkus.deployment.Capability
that could be tested here instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we should probably do that across Quarkus. But probably something for a follow up PR
...ns/scheduler/runtime/src/test/java/io/quarkus/scheduler/runtime/util/SchedulerUtilsTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
I had to juggle around some of the classes and introduce new modules in order to introduce Kotlin support in the same way we have done it for reactive messaging and in order to avoid split package issues.
Resolves: #21428