Fork me on GitHub
#integrant
<
2022-03-01
>
rickmoynihan15:03:23

@drewverlee: Yes there’s a real benefit there. It’s probably easier to understand it in the context of the competition… e.g. mount which associates components with vars/namespaces. The important point is essentially that namespaces and vars are essentially singletons. e.g. in a running process there is really only ever one clojure.core/map; so if your component system ties components to namespaces/vars then things are always by their nature singletons. You can’t for example just reconfigure the system to spawn two slightly different instances of the system at the same time; you would need to code it so it can do that; where as with integrant every system is a value (typically with some associated resources, e.g. sockets/ports); and therefore you can have as many of them as you want. Sure you need to make sure it’s configured so there are no collisions on scarce resources likes port; but it’s fundamentally possible with integrant; and for your app itself not to really care.

👀 1
rickmoynihan15:03:19

A common use case for this; is that you can run both a dev environment (for noodling around by hand) and a test environment for repeatability in the same REPL.