                     (assoc-in old-active-streams
                               [this :real-streams]
                               (conj real-streams stream-name)))))))))
+  (create-virtual-stream-endpoint! [this stream-name]
+    (let [ch (chan (sliding-buffer 1))]
+      (dosync (alter virtual-streams assoc stream-name ch))
+      (mcc/stream-source
+       {:m m} (str "virtual/" stream-name)
+       (fn [params] ch))))
   (create-stream-endpoint! [this stream-name]
     ;; TODO: Fix this mess
     (if (not (nil? m))

  (next! [this] (go (<! (:channel (global-channel this)))))
  EventProcessor
  (register-query! [this projection-name stream-name lang f init]
    (let [s-name (if (nil? stream-name) "__all__" stream-name) 
          function-descriptor (generate-function lang f)
          function (:computable function-descriptor)
          s (stream this {"from" "0" "stream-type" "hot-cold"
                          "stream-name" s-name})
          running-query (ref {:projection-name projection-name

(defonce publications (ref {}))
(defonce global-channels (ref {}))
(defonce active-streams (ref {}))
(defonce virtual-streams (ref {}))


;; Stream protocols and multimethods
