From 5976331c574c8b148c06ea3fdd68a28f69efdbd1 Mon Sep 17 00:00:00 2001 From: Anatoly Date: Sat, 14 Nov 2015 11:15:12 -0500 Subject: [PATCH] [docs]: start/stop parts of an app --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 6b62e0c..a6404f3 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ _**Alan J. Perlis** from [Structure and Interpretation of Computer Programs](htt - [Talking States](#talking-states) - [The Importance of Being Reloadable](#the-importance-of-being-reloadable) - [Start and Stop Order](#start-and-stop-order) +- [Start and Stop Parts of Application](#start-and-stop-parts-of-application) - [Mount and Develop!](#mount-and-develop) - [Running New York Stock Exchange](#running-new-york-stock-exchange) - [Web and Uberjar](#web-and-uberjar) @@ -189,6 +190,22 @@ dev=> (reset) You can see examples of start and stop flows in the [example app](https://github.com/tolitius/mount#mount-and-develop). +## Start and Stop Parts of Application + +In REPL or during testing it is often very useful to work with / start / stop _only a part_ of an application, i.e. "only these two states". + +`mount` start/stop functions _optionally_ take namespaces to start/stop: + +```clojure +(mount/start #'app.config/app-config #'app.nyse/conn) +... +(mount/stop #'app.config/app-config #'app.nyse/conn) +``` + +which will only start/stop `app-config` and `conn` (won't start any other states). + +Here is an [example](test/check/parts_test.clj) test that uses only two namespaces checking that the third one is not started. + ## Mount and Develop! `mount` comes with an example [app](https://github.com/tolitius/mount/tree/master/test/app)