Skip to content

Commit

Permalink
Experimental: add freeze-fallback-as-str fn
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed Dec 3, 2013
1 parent 43c8505 commit 3093eae
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/taoensso/nippy.clj
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,13 @@
(comment (reader-serializable? "hello"))

(def ^:dynamic *final-freeze-fallback* "Alpha - subject to change." nil)
(defn freeze-fallback-as-str "Alpha-subject to change." [x s]
(freeze-to-stream* {:nippy/unfreezable (str x) :type (type x)} s))

(comment
(require '[clojure.core.async :as async])
(binding [*final-freeze-fallback* freeze-fallback-as-str]
(-> (async/chan) (freeze) (thaw))))

;; Fallbacks. Note that we'll extend *only* to (lowly) Object to prevent
;; interfering with higher-level implementations, Ref. http://goo.gl/6f7SKl
Expand Down

0 comments on commit 3093eae

Please sign in to comment.