 ;;; Dummy functions to use in the examples
 
 (defn connect-to-database [host port]
-  (prn "Opening database connection")
+  (println ";; Opening database connection")
   (reify java.io.Closeable
-    (close [_] (prn "Closing database connection"))))
+    (close [_] (println ";; Closing database connection"))))
 
 (defn execute-query [& _]
-  (prn 'execute-query))
+  (println ";; execute-query"))
 
 (defn execute-insert [& _]
-  (prn 'execute-insert))
+  (println ";; execute-insert"))
 
 (defn new-scheduler []
-  (prn 'new-scheduler)
-  {})
+  (reify component/Lifecycle
+    (start [this]
+      (println ";; Starting scheduler")
+      this)
+    (stop [this]
+      (println ";; Stopping scheduler")
+      this)))
 
 
 ;;; Example database component

  component/Lifecycle

  (start [this]
    ;; In the 'start' method, a component may assume that its
    ;; dependencies are available and have already been started.
    (assoc this :admin (get-user database "admin")))

  (stop [this]
    ;; Likewise, in the 'stop' method, a component may assume that its
    ;; dependencies will not be stopped until AFTER it is stopped.
    this))

;; which take a set of keys naming components in the system to be
;; started/stopped. Order of the keys doesn't matter here.

(def example-system-components [:scheduler :app :db])

(defrecord ExampleSystem [config-options db scheduler app]
  component/Lifecycle
  (start [this]
    (component/start-system this example-system-components))
  (stop [this]
    (component/stop-system this example-system-components)))

;; When constructing the system, specify the dependency relationships
;; among components with the `using` function.

(defn example-system [config-options]
  (let [{:keys [host port]} config-options]
