Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. # def-superfetcher <code clojure> (defmacro def-superfetcher [sym bindings do-fetch-fn] `(defrecord ~sym ~bindings u/DataSource (-identity [this#] (:id this#)) (-fetch [this# env#] (unwrap first (~do-fetch-fn [this#] env#))) u/BatchedSource (-fetch-multi [muse# muses# env#] (let [muses# (cons muse# muses#)] (unwrap (fn [responses#] (zipmap (map u/-identity muses#) responses#)) (~do-fetch-fn muses# env#)))))) </code> open/def-superfetcher.txt Last modified: 2024/10/05 06:15by 127.0.0.1