-
Notifications
You must be signed in to change notification settings - Fork 923
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
Add RequestContextStorage.hook()
#2723
Conversation
Motivation: There's currently no way to perform an additional operation on top of the `RequestContextStorage` implementation discovered via `ServiceLoader`. Modifications: - Added `RequestContextStorage.hook(Function)` so that a user is allowed to modify the current `RequestContextStorage`. - `RequestContextStorage` is now `Unwrappable`. - Added `RequestContextStorageWrapper` Result: - A user can install a custom hook in runtime, usually at startup time, like other frameworks.
...t-storage/src/test/java/com/linecorp/armeria/common/CustomRequestContextStorageProvider.java
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.
Thanks! @trustin
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.
Thanks!
core/src/main/java/com/linecorp/armeria/common/RequestContextStorage.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #2723 +/- ##
============================================
- Coverage 72.63% 72.59% -0.04%
+ Complexity 11621 11617 -4
============================================
Files 1022 1023 +1
Lines 45434 45446 +12
Branches 5662 5663 +1
============================================
- Hits 32999 32993 -6
- Misses 9532 9551 +19
+ Partials 2903 2902 -1 Continue to review full report at Codecov.
|
Motivation: There's currently no way to perform an additional operation on top of the `RequestContextStorage` implementation discovered via `ServiceLoader`. Modifications: - Added `RequestContextStorage.hook(Function)` so that a user is allowed to modify the current `RequestContextStorage`. - `RequestContextStorage` is now `Unwrappable`. - Added `RequestContextStorageWrapper` Result: - A user can install a custom hook in runtime, usually at startup time, like other frameworks.
Motivation:
There's currently no way to perform an additional operation on top of
the
RequestContextStorage
implementation discovered viaServiceLoader
.Modifications:
RequestContextStorage.hook(Function)
so that a user is allowedto modify the current
RequestContextStorage
.RequestContextStorage
is nowUnwrappable
.RequestContextStorageWrapper
Result:
like other frameworks.