mount icon indicating copy to clipboard operation
mount copied to clipboard

":with-deps" to manually override the start order / dependencies

Open tolitius opened this issue 8 years ago • 0 comments

In case of indirect dependencies sometimes it is needed to specify a particular order in which they start.

For example if we have a message bus and a subscriber that are indirectly connected via, say, a core.async channel, we need to make sure the subscriber does not start subscribing to the message bus before the bus is started.

It is not a simple task to validate the dependency order just for indirect dependencies:

i.e. in case a state a is "enriched" with a dependency on state b, how do we know that by starting b a bit ​earlier​, to satisfy this dependency, we not hurting it (b) by now not ​yet​ starting states that b naturally depends on

since mount records only a linear dependency / start order.

Therefore the idea (that belongs to @wkf) is to optionally specify all the dependencies on mount start e.g.:

(mount/start-with {:with-deps {... dependency graph / order ...}})

This has to do with start-with rebranding #47, and, as a side effect, will add more dependency graph explicitness.

tolitius avatar Feb 02 '16 16:02 tolitius