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

Expose module heirarchy via context #4892

Closed
mholt opened this issue Jul 17, 2022 · 1 comment
Closed

Expose module heirarchy via context #4892

mholt opened this issue Jul 17, 2022 · 1 comment
Labels
discussion 💬 The right solution needs to be found
Milestone

Comments

@mholt
Copy link
Member

mholt commented Jul 17, 2022

Would it be useful to expose the "path" or hierarchy to every module instance through the caddy.Context? In other words, a Context could return for an instance of a module the instance of a parent/host module that loaded it.

Right now, I think the only way to access a specific instance of a loaded module is to use the App() method which can only return an app module, and those are singletons.

I don't think we have a pressing need for this right now, but it's an interesting idea I had that I wanted to put in the issue tracker in case it becomes useful for something.

@mholt mholt added discussion 💬 The right solution needs to be found deferred ⏰ We'll come back to this later labels Jul 17, 2022
@mholt mholt removed the deferred ⏰ We'll come back to this later label Sep 13, 2022
@mholt
Copy link
Member Author

mholt commented Sep 13, 2022

Actually this turned out to be useful for events, and it's been implemented in #4912.

@mholt mholt closed this as completed Sep 13, 2022
@mholt mholt added this to the v2.6.0 milestone Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion 💬 The right solution needs to be found
Projects
None yet
Development

No branches or pull requests

1 participant