-
Notifications
You must be signed in to change notification settings - Fork 63
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
@Asynchronous doesn't belong in org.eclipse.microprofile.faulttolerance #415
Comments
Thank you @gavinking for your thoughts! Inventing |
@Emily-Jiang yep, great. Indeed, I hope the Concurrency spec will define a relationship between |
I agree with @gavinking that There are many MicroProfile specifications (fault tolerance, rest client...) making assumptions on the execution model (JavaEE execution model). However, this is a blocker for anything reactive and non-blocking as the threading model is very different (avoid thread pools, reuse the threads to handle concurrent requests). So almost all spec will need to be updated if MP wants to embrace reactive. |
+1 for this, Just note that this also means the annotation will entail perf overhead of MP Conc propagation. |
+1 to removing |
I'd agree with removing Off the top of my head, these are the additional things you can do with
One option might be to have an API that allows the user to wrap a MP concurrency executor to produce a new executor which applies Fault Tolerance policies. |
I might be missing something, as I've not been involved except tangentially with this spec so far, but shouldn't what you describe occur irrespective of an If it doesn't, maybe the spec needs some work to reflect it's not tied to it |
@kenfinnigan I think what @Azquelt meant was what it implies if you were running async which isn't the default case it seems. |
I guess there's two questions, "what does the spec say", and "why does it say what it does". I'll try to answer the second question to the best of my knowledge. Everything not annotated with If we're using If you want to apply fault tolerance policies around a
The decision to make |
Right, but it seems to me that these should be additional semantics that Fault Tolerance adds to an That is, I could have an |
The notion of an
@Asynchronous
method is one that's existed in Java EE since it was introduced in EJB 3.1. It was arguably a mistake at the time to have put this annotation in thejavax.ejb
package, instead of allowing it to have been used with any CDI bean, but the history was that at the time CDI was a under a cloud of controversy and trying to present as small a target as possible, and was therefore trying not to step on EJB's toes too much.So the addition of
org.eclipse.microprofile.faulttolerance.Asynchronous
which can, as I understand it, be used on any CDI bean is a big improvement from this point of view. Now, if I'm not misunderstanding, we can add asynchronous methods to any CDI bean. Excellent, if true!However, from what I can tell from a cursory inspection of its documented semantics,
@Asynchronous
doesn't have anything much in the way of semantics that are specific to Fault Tolerance. That makes sense: asynchronicity and fault tolerance are relatively orthogonal concerns, though I can see how there are some semantics that need to be well-defined at their intersection.Nevertheless, asynchronicity isn't an aspect of Fault Tolerance, and therefore it doesn't seem to me that
@Asynchronous
belongs in theorg.eclipse.microprofile.faulttolerance
package. I'm not sure where it does belong, but ... not there.Hrrrrm, perhaps a better place for it to live would be in
org.eclipse.microprofile.concurrent
, since it seems much more closely related to the functionality in that package? I'm not sure.The text was updated successfully, but these errors were encountered: