Created
September 6, 2019 20:31
-
-
Save dimovich/fbe13022a88e4b4ff8f12e3a1c023a26 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; using | |
;; https://github.com/dimovich/fressian-handlers/blob/caching/src/fressian/handlers.clj | |
(require '[fressian.handlers :as fh] | |
'[clojure.data.fressian :as fres] | |
'[clojure.core.async :as async] | |
'[clojure.java.io :as io]) | |
(def ch (async/chan)) | |
(async/go | |
(with-open [out (io/output-stream "test.fress")] | |
(with-open [wrt (fres/create-writer out :handlers (fh/get-write-handler-lookup))] | |
(loop [] | |
(when-let [v (async/<! ch)] | |
(fres/write-object wrt v) | |
(recur)))))) | |
(async/>!! ch [1 2 3]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment