 (defn- send-summary
   "Sends a summary of the published messages, built by the optional
   summary function given at source creation."
-  [{:keys [summary-fn summaries] :as source} topic]
+  [{:keys [config summaries] :as source} topic]
   (debug "Requested to send summary of" topic "to" wamp/*call-sess-id*)
-  (if summary-fn
+  (if (:summary-fn config)
     (let [summary (get @summaries topic)]
       (debug "Sending summary of" topic "to" wamp/*call-sess-id*)
       (trace "Summary is" summary)

            [clj-wamp.server :as wamp]
            [clojure.string :refer (split)]
            [cheshire.core :as json]
            [taoensso.timbre :as timbre])
  (:import [java.net InetAddress URI]
           [java.util UUID]))
(timbre/refer-timbre)

  "Given the return value of `start-source`, this stops the Websocket
  server and removes every topic for this source from the directory
  service."
  [{:keys [stop-fn open dirwriter topics config] :as source}]
  (when @open
    (info "Stopping websocket source, using state" source)
    (reset! open false)
    (doseq [topic-agent (vals @topics)]
      (send topic-agent done-action config))
    (@stop-fn :timeout 100)))
