make some more internal-use functions private
This commit is contained in:
parent
3c1b145f2d
commit
3e28d19474
|
@ -253,10 +253,7 @@
|
||||||
(catch Exception e
|
(catch Exception e
|
||||||
(error e "error refreshing:" namespace view-id parameters))))
|
(error e "error refreshing:" namespace view-id parameters))))
|
||||||
|
|
||||||
(defn refresh-worker-thread
|
(defn- refresh-worker-thread
|
||||||
"Returns a refresh worker thread function. A 'refresh worker' continually waits for
|
|
||||||
refresh requests and when there is one, handles it by running the view, getting the view
|
|
||||||
data and then sending it out to all the view's subscribers. "
|
|
||||||
[^Atom view-system]
|
[^Atom view-system]
|
||||||
(let [^ArrayBlockingQueue refresh-queue (:refresh-queue @view-system)]
|
(let [^ArrayBlockingQueue refresh-queue (:refresh-queue @view-system)]
|
||||||
(fn []
|
(fn []
|
||||||
|
@ -269,11 +266,7 @@
|
||||||
(recur)
|
(recur)
|
||||||
(trace "exiting worker thread")))))
|
(trace "exiting worker thread")))))
|
||||||
|
|
||||||
(defn refresh-watcher-thread
|
(defn- refresh-watcher-thread
|
||||||
"Returns a refresh watcher thread function. A 'refresh watcher' continually attempts
|
|
||||||
to schedule refreshes for any views in the system which are 'dirty' (a dirty view in
|
|
||||||
this case is one when there is a hint waiting in the view-system that is relevant
|
|
||||||
to the view)."
|
|
||||||
[^Atom view-system min-refresh-interval]
|
[^Atom view-system min-refresh-interval]
|
||||||
(fn []
|
(fn []
|
||||||
(let [last-update (:last-update @view-system)]
|
(let [last-update (:last-update @view-system)]
|
||||||
|
@ -289,8 +282,8 @@
|
||||||
(trace "exiting refresh watcher thread")))))
|
(trace "exiting refresh watcher thread")))))
|
||||||
|
|
||||||
(defn start-update-watcher!
|
(defn start-update-watcher!
|
||||||
"Starts threads for the views refresh watcher and worker threads that handle
|
"Starts threads for the views refresh watcher and worker threads that handle queued
|
||||||
view refresh requests."
|
hints and view refresh requests."
|
||||||
[^Atom view-system min-refresh-interval threads]
|
[^Atom view-system min-refresh-interval threads]
|
||||||
(trace "starting refresh watcher at" min-refresh-interval "ms interval and" threads "workers")
|
(trace "starting refresh watcher at" min-refresh-interval "ms interval and" threads "workers")
|
||||||
(if (and (:refresh-watcher @view-system)
|
(if (and (:refresh-watcher @view-system)
|
||||||
|
@ -330,9 +323,7 @@
|
||||||
:refresh-watcher nil
|
:refresh-watcher nil
|
||||||
:workers nil)))
|
:workers nil)))
|
||||||
|
|
||||||
(defn logger-thread
|
(defn- logger-thread
|
||||||
"Returns a logger thread function. A logger periodically writes view system
|
|
||||||
statistics to the log that are collected only when logging is enabled."
|
|
||||||
[^Atom view-system msecs]
|
[^Atom view-system msecs]
|
||||||
(let [secs (/ msecs 1000)]
|
(let [secs (/ msecs 1000)]
|
||||||
(fn []
|
(fn []
|
||||||
|
|
Loading…
Reference in a new issue