This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-26
Channels
- # admin-announcements (3)
- # beginners (44)
- # boot (48)
- # cljs-dev (2)
- # cljsjs (14)
- # cljsrn (2)
- # clojure (32)
- # clojure-android (1)
- # clojure-nl (1)
- # clojure-portugal (1)
- # clojure-russia (7)
- # clojure-spec (51)
- # clojure-uk (21)
- # clojurescript (9)
- # component (2)
- # cursive (4)
- # emacs (5)
- # funcool (1)
- # hispano (3)
- # hoplon (10)
- # immutant (14)
- # jobs (1)
- # jobs-discuss (4)
- # off-topic (15)
- # om (1)
- # onyx (1)
- # planck (36)
- # re-frame (2)
- # reagent (25)
- # spacemacs (2)
- # spirituality-ethics (10)
- # untangled (2)
- # vim (8)
- # yada (1)
ok so I put (core/cleanup (do (boot.util/warn "Cleanup called\n") (worker-pods :shutdown)))
in boot-test
and the cleanup code is not called on every watch
iteration` but only when exiting the pipeline...there is a :refresh
though so pods should be closed there I guess
@richiardiandrea: yes we don't want cleanup
to be called except when the pipeline finishes
cause it's there to clean up the mutable state whose lifetime is one pipeline, like a http server for example
yes, I figured that out, I went ahead and investigated
it looks like boot-test
is using the pod-pool
which calls destroy-pod` for each
:refresh
but does not remove them from pod/pods
it seems like, but I will be sure in a couple of minutes
might be wrong 😉
k let me check if that works than
yeah rt.invoke("boot.pod/set-this-pod!", new WeakReference<ClojureRuntimeShim>(rt));
it is WeakHashMap<ClojureRuntimeShim, Object>
yeah I saw that new Object()
if you exec code in the pod in a Thread...and the thread is in a pool...will it keep the references? probably yes
apparently there is a thing: http://docs.oracle.com/javase/6/docs/api/java/util/Collections.html#newSetFromMap%28java.util.Map%29
wow cool
https://github.com/arichiardi/boot/blob/fix-pod-leak/boot/pod/src/boot/pod.clj#L346
it is invoking the operation in a pod in a future...
the deref future business is to prevent issues when you call (with-invoke-in p ...)
and p
is the current pod
kk, lol
so we call the pod from another thread, but it should hold references, i wouldn't think
I did a memory dump while the memory was growing and growing and it calls that line...I was investigating the consequences
maybe I can just spawn a thread there and see what happens
https://github.com/clojure/clojure/blob/clojure-1.7.0/src/clj/clojure/core.clj#L6680
they run in an agent
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Agent.java#L53
attempting a rough:
(let [pod# ~pod
value# (atom nil)]
(if (not= pod# (.get this-pod))
(.invoke pod# ~(str sym) ~@args)
(do (doto (Thread. #(reset! value# (.invoke pod# ~(str sym) ~@args)) "My test thread")
(.start)
(.join))
value#)))
uhm scratch that lol
I am caching myself ahah
no wait...it should be ok...but still is wrong...
hmm I’m not quite sure why, but when trying to include css from cljsjs packages into the target output, nothing seems to work: https://github.com/cljsjs/boot-cljsjs/issues/21 (or) http://hoplon.discoursehosting.net/t/how-do-i-include-the-css-from-a-cljsjs-package/443
i tried shift, move, (from-cljsjs), :add-jar, to-resource, but nothing… i dont know if my regex’s are wrong, or i’m configuring things incorrectly, but none of these work:
(from-cljsjs :profile :development)
(sift :add-jar {'cljsjs/react-toolbox #".*react-toolbox.css$"})
(sift :to-resource #{#".*react-toolbox.inc.css"})
(sift :move {#".*react-toolbox.css$" "css/react-toolbox.css"})