Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

respect java.lang.AutoCloseable #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/juxt/clip/impl/core.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@
stop-code
(evaluator stop-code {'this inst})
#?@(:clj
[(isa? (class inst) java.io.Closeable)
(.close ^java.io.Closeable inst)])))
[(instance? java.lang.AutoCloseable inst)
(.close ^java.lang.AutoCloseable inst)])))

(defn component-chain
[system]
Expand All @@ -235,7 +235,7 @@
(defn StatefulThing
[]
(reify
java.io.Closeable
java.lang.AutoCloseable
(close [this]
(println "Closing a stateful thing"))))
(def system2
Expand Down
2 changes: 1 addition & 1 deletion test/juxt/clip/core_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@

(let [closed? (atom false)
auto-closable (reify
java.io.Closeable
java.lang.AutoCloseable
(close [this]
(reset! closed? true)))]
(clip/stop {:components
Expand Down