Skip to content
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

TimedInterceptor specifies order #549

Open
lightbody opened this issue May 24, 2023 · 1 comment
Open

TimedInterceptor specifies order #549

lightbody opened this issue May 24, 2023 · 1 comment

Comments

@lightbody
Copy link
Contributor

Feature description

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.

@lightbody
Copy link
Contributor Author

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant