Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Check type when building pipe.

  • Loading branch information...
commit fc6c31d38021690ee24a6a7b649990604fbdcd3e 1 parent ca9cd9f
Darrick Wiebe authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/pacer/pacer.clj
View
9 src/pacer/pacer.clj
@@ -28,6 +28,11 @@
([graph]
(conj [graph] (first (v)))))
+(defn- check-step [in step]
+ (when (not= (:source-type step) (:type in))
+ (throw (Exception. (str (describe-step step) " expects type "
+ (:source-type step) " but got " (:type in))))))
+
(defn- pipe-from-step [in step]
(cond
(:pipe step) (doto (:pipe step)
@@ -39,9 +44,9 @@
"Build a pipe from a route definition"
[[source & route]]
(reduce (fn [in step]
- (pprint in)
+ (check-step in step)
{ :pipe (pipe-from-step in step)
:type (:type step (:type in))
:route (conj (:route in) step)})
- { :source source :route [] }
+ { :source source, :type (:type source), :route [] }
route))
Please sign in to comment.
Something went wrong with that request. Please try again.