You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently MP Concurrency has the pattern of 3 classes per object:
core interface (e.g. ManagedExecutor)
config annotation (e.g. @ManagedExecutorConfig)
builder interface (e.g. ManagedExecutorBuilder)
To make it a bit more obvious that these objects go together, I propose that we collect the config annotation and builder interface into the core interface as inner-classes, like this:
// Single import statement for core, config, and builderimportorg.eclipse.microprofile.concurrent.ManagedExecutor;
publicclassMyBean {
@Inject@ManagedExecutor.Config(maxAsync = 5)
publicManagedExecutorex;
@ProducespublicManagedExecutordefaultExec() {
returnManagedExecutor.Builder.instance()
.maxAsync(5)
.build();
}
}
The text was updated successfully, but these errors were encountered:
Thanks for the suggestion. In general this is a good idea, but the CDI qualifier annotation @ManagedExecutorConfig will soon end up with a dependency on CDI (which isn't there currently, but it is being fixed in another pull) and this proposal would result in the MP Concurrency spec having a main path dependency on CDI, which we are trying to avoid.
My comment above no longer applies. We will not be using Qualifier. However @ManagedExecutor.Config looks awkward. Moving the builder under ManageedExecutor does seem reasonable.
I think moving the build class as an inner class is good idea as it makes it easier to use, +1 for that.
But I would keep the annotation as a separate class.
Currently MP Concurrency has the pattern of 3 classes per object:
ManagedExecutor
)@ManagedExecutorConfig
)ManagedExecutorBuilder
)To make it a bit more obvious that these objects go together, I propose that we collect the config annotation and builder interface into the core interface as inner-classes, like this:
The text was updated successfully, but these errors were encountered: