January 2018
Intermediate to advanced
336 pages
7h 56m
English
To integrate mount with the Helping Hands Consumer service project, create a state for a Datomic database connection within the helping-hands.consumer.state namespace, as shown here:
(ns helping-hands.consumer.state "Initializes State for Consumer Service" (:require [mount.core :refer [defstate] :as mount] [helping-hands.consumer.persistence :as p]))(defstate consumerdb :start (p/create-consumer-database) :stop (.stop consumerdb))
The :start clause is called at the time of startup and :stop is called at shutdown. The function stop is defined for the ConsumerDB protocol, as shown in the following example under the helping-hands.consumer.persistence namespace:
(ns helping-hands.consumer.persistence "Persistence ...
Read now
Unlock full access