hiposfer / hive

Your go-to routing app for public transport
GNU Lesser General Public License v3.0
10 stars 0 forks source link

generalize forwarding mechanism #61

Closed carocad closed 6 years ago

carocad commented 6 years ago

A lot of service are going to be simply a composition of smaller ones.

The code for it is generally the same and can be generalized by just requesting a spec, a function and some optional arguments.

 (if-not (nil? chan) this
      (let [chan (async/chan 3)]
        (go-loop [_ nil]
          (let [request (async/<! chan)]
            (if (nil? request) nil ;; stops looping
              (if (s/valid? ::request request)
                (recur (handle! (assoc request ::access_token (:mapbox config))
                                (:chan http)))
                (recur (s/explain ::request request))))))
carocad commented 6 years ago

this is no longer valid as we dont use the architecture anymore