Make initial views compute queries in parallel.

This commit is contained in:
Alexander K. Hudek 2014-10-18 17:57:17 -04:00
parent 970cb80670
commit b1550b1fc1
2 changed files with 4 additions and 4 deletions

View file

@ -1,4 +1,4 @@
(defproject views "0.3.0"
(defproject views "0.4.0"
:description "You underestimate the power of the SQL side"
:url "https://github.com/diligenceengine/views"

View file

@ -58,10 +58,10 @@
view-sigs (view-filter msg (view-sig-fn* view-sig-fn msg) templates {:unsafe? unsafe?})] ; this is where security comes in.
(debug "Subscribing views: " view-sigs " for subscriber " subscriber-key ", in namespace " namespace)
(when (seq view-sigs)
(thread
(doseq [vs view-sigs]
(let [iv (subscribe-and-compute db persistence templates vs namespace subscriber-key)]
(send-fn* send-fn subscriber-key :views.init iv)))))))
(thread
(let [iv (subscribe-and-compute db persistence templates vs namespace subscriber-key)]
(send-fn* send-fn subscriber-key :views.init iv)))))))
(unsubscribe-views
[this msg]