 
 (defn foreach-rdd [dstream f]
   (.foreachRDD dstream (function2 f)))
+
+
+;; ## Output
+;;
+(defn save-as-text-files
+  ;;TODO: check whether first param is of type
+  ;;DStream or just let an exception be thrown?
+  ([dstream prefix suffix]
+    (.saveAsTextFiles dstream prefix suffix))
+  ([dstream prefix]
+   (.saveAsTextFiles dstream prefix)))

      (.groupByKeyAndWindow (duration window-length) (duration slide-interval))
      (.map (function f/untuple))))

(defn reduce-by-window [dstream f window-length slide-interval]
  (.reduceByWindow dstream (function2 f) (duration window-length) (duration slide-interval)))

(defn reduce-by-key-and-window [dstream f window-length slide-interval]
  (-> dstream

;; Spark Streaming; consider it a work in progress.
;;
(ns flambo.streaming
  (:refer-clojure :exclude [map time print union count])
  (:require [flambo.api :as f]
            [flambo.conf :as conf]
            [flambo.function :refer [flat-map-function
