This file contains hidden or 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
(import '[io.netty.util Recycler]) | |
(defprotocol Recyclable | |
(recycle! [this] "Recycles this object.")) | |
(defprotocol Init | |
(init! [this values])) | |
(defmacro defrecyclable | |
[name fields & {:keys [max-capacity] :or {max-capacity 8096}}] |
This file contains hidden or 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
(defn distinct-by | |
"Like distinct, but uses f to consider what duplicate values are." | |
([f] | |
(fn [rf] | |
(let [seen (volatile! #{})] | |
(fn | |
([] (rf)) | |
([result] (rf result)) | |
([result input] | |
(let [v (f input)] |
This file contains hidden or 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
Start a in-memory S3-compatible (kinda...) server. | |
Uses https://github.com/csm/s4 |
OlderNewer