This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-09-13
Channels
- # announcements (2)
- # babashka (2)
- # beginners (112)
- # calva (29)
- # cider (33)
- # clj-kondo (41)
- # cljdoc (10)
- # cljs-dev (2)
- # clojure (72)
- # clojure-berlin (3)
- # clojure-europe (10)
- # clojure-italy (6)
- # clojure-nl (15)
- # clojure-spec (5)
- # clojure-uk (40)
- # clojurescript (1)
- # clr (6)
- # community-development (6)
- # core-async (21)
- # cursive (42)
- # datascript (12)
- # duct (6)
- # flambo (1)
- # fulcro (50)
- # jobs (1)
- # leiningen (3)
- # off-topic (16)
- # re-frame (6)
- # reagent (23)
- # reitit (7)
- # ring-swagger (14)
- # shadow-cljs (35)
- # tools-deps (39)
- # vim (12)
Thanks for the repro @thomas559. It seems to be issue in #aleph, which doesn’t seem to close the InputStream
s properly. Tested with Jetty, which handled those ok. If you return (ByteArrayInputStream. (.getBytes ^String (json/write-str sample-map)))
from handler2, it fails too on aleph
it should close those based on source code: https://github.com/ztellman/aleph/blob/master/src/aleph/http/core.clj#L336-L337
I have tried to push support of byte-arrays to all web servers, so we could change the default to :bytes
. It’s much faster as there is no extra wrapping into Streams & the servers can use NIO for non-blocking send. Aleph at least supports that, so good for this case.
@ikitommi - I guess the reason it hasn't come up is because most people using muuntaja with aleph are already defaulting to bytes. I came to reitit without having used muuntaja previously, so I've only thought about configuring it when I run into problems (eg customizing json key parsing). I've moved us over to using the bytes option now - it's really fast!