                chsk-router (sente/start-chsk-router! ch-recv event-handler)]
            (tap event-mult inspect-chan)
            (event-loop inspect-chan connected-uids send-fn)
+           (go-loop []
+                    (<! (timeout 10000))
+                    (>! inspect-chan [:send-stats])
+                    (recur))
            (assoc component
              :ajax-post-fn ajax-post-fn
              :ajax-get-or-ws-handshake-fn ajax-get-or-ws-handshake-fn

   [clojure.core.match :as match :refer (match)]
   [taoensso.sente :as sente]
   [com.stuartsierra.component :as component]
   [clojure.core.async :as async :refer [chan <! put! tap untap-all sub unsub-all go-loop]]))

(defn- user-id-fn
  "generates unique ID for request"

      (match event
             [:cmd/get-next-items params] (get-next-items inspect-chan params full-event)
             [:cmd/initialize params]     (initialize-inspector params full-event chsk-send!)
             [:cmd/get-stats]             (chsk-send! (strip-uid (:client-uuid full-event)) [:info/stats @stats])
             [:chsk/ws-ping]              () ; currently just do nothing with ping (no logging either)
             [:chsk/uidport-open]         () ; user-id-fn already logs established connection
             [:chsk/uidport-close]        (close-connection inspect-chan (strip-uid (:client-uuid full-event)))
             :else                        (log/debug "Unmatched event:" event)))))

(defn handle-event
  "handles events coming in through the inspect function, includes updating stats"
  [uids msg chsk-send!]
  (let [origin (:origin msg)]
    (swap! stats assoc origin (inc (get @stats origin 0)))
    (doseq [uid (:any @uids)]
      (when (pos? (get-in @client-maps [uid origin] 0))
        (chsk-send! uid [:info/msg (assoc msg :payload (with-out-str (pp/pprint (:payload msg))))])
