yada

OliverM 2018-10-24T07:55:23.000100Z

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.

borkdude 2018-10-24T08:08:11.000100Z

(this worked btw: https://clojurians.slack.com/archives/C0702A7SB/p1540198897000100)

borkdude 2018-10-24T09:10:57.000100Z

Made a branch of yada with speculative tests. Found no errors. https://github.com/borkdude/yada/tree/speculative-tests

👍 1
stijn 2018-10-24T13:56:51.000100Z

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*))?

mccraigmccraig 2018-10-24T14:26:23.000100Z

@stijn you could give it a java.io.StringWriter too - presumably you are going to call this thing on a manifold.deferred/future ?

stijn 2018-10-24T15:14:35.000100Z

that might indeed be a problem on a different thread

stijn 2018-10-24T15:15:25.000100Z

@mccraigmccraig but what about the with-open that's usually used for this kind of writing. does that work with futures?

mccraigmccraig 2018-10-24T15:20:51.000100Z

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

mccraigmccraig 2018-10-24T15:26:43.000100Z

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