panini icon indicating copy to clipboard operation
panini copied to clipboard

middleware inheritance

Open oleksii-volotskov opened this issue 4 years ago • 3 comments

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 avatar Mar 17 '21 11:03 oleksii-volotskov

That a good question, please look at NatsTimeoutMiddleware implementation here

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

danylott avatar Mar 17 '21 11:03 danylott

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

oleksii-volotskov avatar Mar 17 '21 11:03 oleksii-volotskov

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

danylott avatar Mar 17 '21 12:03 danylott