-
Notifications
You must be signed in to change notification settings - Fork 190
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 PluginExt extension trait and FilterByOperationName plugin #1837
Conversation
@@ -193,8 +193,11 @@ pub use upgrade::*; | |||
/// | |||
/// The `L` is held and applied lazily during [`Upgradable::upgrade`]. | |||
pub struct Operation<S, L = Identity> { | |||
inner: S, | |||
layer: L, | |||
/// The inner [`Service`](tower::Service) representing the logic of the operation. |
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.
These have become public in order to allow Plugin
developers access to them.
Is this too severe? Maybe we should document that the average customer should use the from_handler
/from_service
methods?
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.
If we want customers to be able to write their own plugins, along the same lines of what we are doing here with the filtering, I don't see many other options.
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
d3b77c3
to
6340483
Compare
A new generated diff is ready to view.
A new doc preview is ready to view. |
Motivation and Context
Customers may not want to apply a
Plugin
to every operation in their service. They might want to filter application by operation name.Description
Plugin
s to live in their own folders.PluginExt
extension trait, which has methodsstack
andfilter_by_operation_name
.FilterByOperationName
Plugin
.