-
Notifications
You must be signed in to change notification settings - Fork 64
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
Access to parameters a component was started with #45
Comments
For your particular problem, why not store the information you need in the system? So instead of just returning a HTTP server object, you could return a map like Alternatively, even though HTTP server objects aren't data, they can often still be queried to find information like the port they're running under, if that's what you want. Another possible option is to define your own |
My reluctance to create a map is slightly aesthetic, but a big sell of integrant for me is that things don't need to be wrapped. Maybe this is something I need to concede on though.
The port was one part, the bit that was missing was the handler. I don't have access to that from my particular object. Using the handler, I can inspect it for bidi vhosts and use that to figure out which url(s) the user can find their application on.
That's an interesting idea to pursue. But does complicate integration with libraries such as integrant-repl. |
One way of doing this once you have an initialized system is to use this fn: (defn conf-with-sys
"Returns the configuration, replacing the references with the initated components,
Same as what `ig/init-key` receives, just for the whole system."
([] (conf-with-sys integrant.repl.state/config integrant.repl.state/system))
([conf sys] (#'ig/expand-key sys conf))) |
This problem can now be solved with |
Very similar to #25. Perhaps also touching on #21.
I'm trying to print out some metadata about the running system in dev mode, namely running http server(s). My approach to this has been to query the integrant-repl.state variables
system
andconfig
. However, I realized that (obviously) the config hasn't resolvedig/ref
at all.#21 would suggest that one solution is to have a printing-component, which has an
#ig/ref
to all components in the system (perhaps filled by a function which performs a transformation).The text was updated successfully, but these errors were encountered: