This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-24
Channels
- # announcements (1)
- # aws (2)
- # beginners (147)
- # boot (19)
- # cider (57)
- # clara (52)
- # cljdoc (18)
- # cljs-dev (14)
- # cljsrn (4)
- # clojure (176)
- # clojure-conj (9)
- # clojure-dev (9)
- # clojure-germany (2)
- # clojure-italy (4)
- # clojure-spec (13)
- # clojure-uk (56)
- # clojurescript (72)
- # code-reviews (11)
- # cursive (17)
- # data-science (1)
- # datomic (52)
- # duct (26)
- # emacs (6)
- # events (9)
- # figwheel (1)
- # figwheel-main (21)
- # fulcro (132)
- # funcool (1)
- # graphql (3)
- # jobs-discuss (42)
- # leiningen (3)
- # luminus (45)
- # mount (10)
- # off-topic (2)
- # re-frame (17)
- # reagent (12)
- # reitit (20)
- # ring-swagger (7)
- # rum (3)
- # shadow-cljs (256)
- # slack-help (15)
- # sql (7)
- # tools-deps (50)
- # uncomplicate (1)
- # yada (9)
Thanks @malcolmsparks I’m really interested in how it might work as the main bus of an application. I’ll give it a go myself and see what comes out.
(this worked btw: https://clojurians.slack.com/archives/C0702A7SB/p1540198897000100)
Made a branch of yada with speculative tests. Found no errors. https://github.com/borkdude/yada/tree/speculative-tests
if I want to use something that needs a java.io.Writer to create the body for a yada response, what is a good way to do this (i.e. what type of 'thing' do I write to? does yada e.g. create content from an OutputStream. what should I do to make sure the writer doesn't get closed before the request is returned?) Or is it just easier to use (with-out-str (write-the-thing *out*))
?
@stijn you could give it a java.io.StringWriter
too - presumably you are going to call this thing on a manifold.deferred/future
?
@mccraigmccraig but what about the with-open that's usually used for this kind of writing. does that work with futures?
it doesn't matter for a StringWriter
- it doesn't actually hold any i/o resources open - if it were something like a FileWriter
with a file-handle though you could use with-open
inside the body of the future
looking at with-out-str
it just uses a StringWriter
so probly use that https://github.com/clojure/clojure/blob/b98ba848d04867c5542d50e46429d9c1f2472719/src/clj/clojure/core.clj#L4682