Last active
January 4, 2016 10:59
-
-
Save daveray/8611948 to your computer and use it in GitHub Desktop.
transient + core.async
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
; Is there a way to tell assoc! "No really, I know what I'm doing." | |
; Do I know what I'm doing? | |
(->> (async/to-chan [[:a 1] [:b 2] [:c 3]]) | |
(async/reduce (fn [acc [k v]] | |
(assoc! acc k v)) | |
(transient {})) | |
(async/map< persistent!) | |
(async/<!!)) | |
;=> | |
; Exception in thread "async-dispatch-52" java.lang.IllegalAccessError: Transient used by non-owner thread | |
; at clojure.lang.PersistentArrayMap$TransientArrayMap.ensureEditable(PersistentArrayMap.java:449 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment