All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.reborg.applenews_api.parallel.clj Maven / Gradle / Ivy

Go to download

Java/Clojure client for the Apple News REST api (https://developer.apple.com/go/?id=news-api-ref)

There is a newer version: 1.0.9
Show newest version
(ns net.reborg.applenews-api.parallel)

(defn ppmap
  "Like pmap in std lib with a configurable chunk size."
  [f coll n]
  (let [rets (map #(future (f %)) coll)
        step (fn step [[x & xs :as vs] fs]
               (lazy-seq
                 (if-let [s (seq fs)]
                   (cons (deref x) (step xs (rest s)))
                   (map deref vs))))]
    (step rets (drop n rets))))




© 2015 - 2025 Weber Informatics LLC | Privacy Policy