Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kul
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kul/15a6cdb8862586248473 to your computer and use it in GitHub Desktop.
Save kul/15a6cdb8862586248473 to your computer and use it in GitHub Desktop.
carbonite clojure tip
(def ^ThreadLocal kryo-registry
(proxy [ThreadLocal] []
(initialValue []
(doto (co/default-registry) (comment register-custom)))))
(defn- freeze
[data]
(cb/write-bytes (.get kryo-registry) data))
(defn- thaw
[bytez]
(cb/read-bytes (.get kryo-registry) bytez))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment