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
TimedInterceptor doesn't override getOrder and return a specific value, so it gets 0. The docs for Ordered claim "Defaults to zero (no order)", but from my reading of how things work, 0 just means it'll happen before all the defined phases in InterceptPhase.
That means, if you put @Timed and @Async on the same method, I think you end up timing the tiny of bit code that kicks off the async work and not the actual work, which is probably not what most people would expect.
My proposal: have it return InterceptPhase.TRACE.
The text was updated successfully, but these errors were encountered:
Might also be worth changing the comment on Ordered to not say "no order" to clarify that it only means no defined order relative to other 0 values, but it definitely will come before any InterceptPhase work :)
Feature description
TimedInterceptor doesn't override
getOrder
and return a specific value, so it gets0
. The docs forOrdered
claim "Defaults to zero (no order)", but from my reading of how things work,0
just means it'll happen before all the defined phases inInterceptPhase
.That means, if you put
@Timed
and@Async
on the same method, I think you end up timing the tiny of bit code that kicks off the async work and not the actual work, which is probably not what most people would expect.My proposal: have it return
InterceptPhase.TRACE
.The text was updated successfully, but these errors were encountered: