mount

raymcdermott 2016-01-07T09:14:02.000186Z

+1

timgilbert 2016-01-07T18:57:40.000187Z

Say, is the general idea in mount to keep every (defstate) in a single namespace, because it uses the namespace tree for dependencies? I have been tempted to put two distinct states in one namespace, but if one depends on another I don't know how I'd specify that.

tolitius 2016-01-07T19:00:14.000188Z

@timgilbert: nope. no such general idea. dependency is built by the Clojure Compiler, it will know what to do :simple_smile:

tolitius 2016-01-07T19:00:44.000189Z

you can group defstates in a namespace if it makes sense

tolitius 2016-01-07T19:02:03.000190Z

@danboykis did an example you can check out: https://github.com/danboykis/shipper/blob/master/src/shipper/postal.clj

timgilbert 2016-01-07T19:02:34.000193Z

Oh, interesting, thanks

tolitius 2016-01-07T19:02:59.000194Z

does not mean you should follow it, but in general, no restrictions. you are the best to make that judgement :simple_smile:

timgilbert 2016-01-07T19:03:16.000195Z

I'm mildly surprised that that example code uses postal-queue before its defstate is defined, but I guess that's the magic of macros

timgilbert 2016-01-07T19:03:41.000196Z

But anyways, that's very helpful, cheers 🍻

tolitius 2016-01-07T19:04:12.000197Z

you mean here: https://github.com/danboykis/shipper/blob/master/src/shipper/postal.clj#L9 ?

tolitius 2016-01-07T19:05:01.000199Z

right, this is a common patter in mount, you want to have an access to the state instance to :stop / :suspend / :resume it

tolitius 2016-01-07T19:06:22.000200Z

*in case you need the instance of course, in some cases you don't..