+1
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.
@timgilbert: nope. no such general idea. dependency is built by the Clojure Compiler, it will know what to do :simple_smile:
you can group defstates in a namespace if it makes sense
@danboykis did an example you can check out: https://github.com/danboykis/shipper/blob/master/src/shipper/postal.clj
Oh, interesting, thanks
does not mean you should follow it, but in general, no restrictions. you are the best to make that judgement :simple_smile:
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
But anyways, that's very helpful, cheers 🍻
you mean here: https://github.com/danboykis/shipper/blob/master/src/shipper/postal.clj#L9 ?
right, this is a common patter in mount, you want to have an access to the state instance to :stop
/ :suspend
/ :resume
it
*in case you need the instance of course, in some cases you don't..