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

middleware inheritance #87

Open
oleksii-volotskov opened this issue Mar 17, 2021 · 3 comments
Open

middleware inheritance #87

oleksii-volotskov opened this issue Mar 17, 2021 · 3 comments
Labels
bug Something isn't working discussion required documentation Improvements or additions to documentation

Comments

@oleksii-volotskov
Copy link
Collaborator

oleksii-volotskov commented Mar 17, 2021

Let's assume that we have ParentMiddleware which has overloaded method listen_any and ChildMiddleware which inherited from ParentMiddleware and has not any of required methods.

In that case, ChildMiddleware cannot be used

@oleksii-volotskov oleksii-volotskov added bug Something isn't working discussion required labels Mar 17, 2021
@danylott
Copy link
Contributor

That a good question, please look at NatsTimeoutMiddleware implementation here

So ChildMiddleware must "re-call" the parent methods if no changes

@oleksii-volotskov
Copy link
Collaborator Author

oleksii-volotskov commented Mar 17, 2021

Thanks!

In this case, do an user have to "re-call" all the methods, or only one is enough?

I guess this approach can be counterintuitive to an user

@danylott
Copy link
Contributor

danylott commented Mar 17, 2021

do an user have to "re-call" all the methods, or only one is enough?

Those, that were overloaded in parent (not important to call all)

I guess this approach can be counterintuitive to an user

You are right, but an inheritance from not standard Middleware interface is an advanced topic, and we can write about that in the documentation, that will come with time

@artas728 artas728 added the documentation Improvements or additions to documentation label Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working discussion required documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants