   ([source execution-mode]
    (cond
      (= execution-mode :single-thread) (OutputSplitter. source (atom []))
-     (= execution-mode :multi-thread) (ThreadedOutputSplitter. source (atom []))
+     (= execution-mode :multi-thread) (ThreadedOutputSplitter. source (atom []) (threadpool 4))
      :else (throw (ex-info (format "Don't know about '%s' execution mode."
                                    execution-mode)
                            :cause {:execution-mode execution-mode})))))

    this))


(deftype ThreadedOutputSplitter [source sinks]
  proto/Splitter
  (connect
    [this sink operation-map]
    ;; Simply puts the sink and it's operation-map into sinks vector
    (let [m (or operation-map op/default-operations)]
      (swap! sinks conj [sink m])))

  (commit
    [this]
    (doseq [[sink op-map] @sinks]
      (connect-threaded source sink op-map))
    this))


(defn output-splitter
  "Create and return an output-splitter for the given `source` channel."
  ([source]

    (doseq [x [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24]]
      (streams/put! a x))
    (read b "b")
    (read c "c")

    (streams/close! a)
    (streams/close! b)
    (streams/close! c)))
