                 text "streaming...")
       (go
         (loop [elem (<! ch)]
-          (if (not (empty? @sockets))
+          (when (not (empty? @sockets))
             (let [edn (prn-str elem)
                   bs (bytes (byte-array (map (comp byte int) edn)))]
               (dorun (pmap #(let [os (.getOutputStream %)]

          virtual-stream (get (:virtual-streams @state) projection-name)
          ch (:channel virtual-stream)
          mult-ch (:mult-channel virtual-stream)
          telnet-tap (chan (sliding-buffer 1))
          _ (log/info "Retrieving stream for" projection-name)
          new-descriptor (merge {:projection-name projection-name
                                 :fn (:persist function-descriptor)

  (let [c (chan 1)
        mult-global (mult c)
        global-channel {:channel c :mult-channel mult-global}
        telnet-projections-channel (chan (sliding-buffer 1024))
        telnet-events-channel (chan (sliding-buffer 1024))
        telnet-mix (mix telnet-projections-channel)
        projection-channel (chan)
        projection-mix (mix projection-channel)
