Fork me on GitHub
#yada
<
2017-05-02
>
lmergen10:05:33

hmmm, i couldn’t find this in the documentation directly — i remember “back in the day”, you would use HTTP multipart responses to get a very long-running request. is this still supported in yada, or is SSE the only way to go ?

malcolmsparks10:05:26

Yes. You should be able to do long running responses.

malcolmsparks10:05:38

The SSE implementation is built on top

lmergen10:05:46

okay, that’s great to know

lmergen10:05:21

is it just a matter of returning a manifold stream ? or is there anything else to it ?

malcolmsparks11:05:20

Just the stream should do

lmergen11:05:20

great, thanks

borkdude14:05:13

I’m trying to get our Yada API to respond with the Schema error in case of a 400, but it seems to limited by this: https://github.com/juxt/yada/blob/5d49342bcb994309b96673fb4a531ff313647c79/src/yada/handler.clj#L57

malcolmsparks14:05:17

For now, you can replace with your own error interceptor chain

malcolmsparks14:05:50

It is a bit arduous but worthwhile because you're then in complete control of error handlinh

borkdude15:05:59

For now I used a filthy (intern 'yada.handler 'error-representations ...) hack + overrode render-error for “application/json”, but I’ll put a note of what you recommended in case I run into more trouble.

borkdude19:05:11

Manifold question: why is this not 2?

(let [d (d/chain
             (d/deferred)
             inc)]
      (d/success! d 1)
      <@U1DHX2E5V>)

borkdude19:05:28

Didn’t work the way I thought:

(do
    (let [d1 (d/deferred)
          d2 (d/chain
             d1
             inc)]
      (d/success! d1 1)
      @d2)) ;;=> 2

lmergen19:05:05

@borkdude it works similar as a promise ?

lmergen19:05:23

you’re thinking about manifold streams, i think

borkdude19:05:50

I was thinking core.async channel + transducer

lmergen19:05:01

yeah i see now what you were thinking

lmergen19:05:41

yeah you can’t “fulfill” a chain like you would with a deferred

lmergen19:05:26

it starts with the first deferred you provide it

lmergen19:05:05

@borkdude take al ook at the stream operators here https://github.com/ztellman/manifold/blob/master/docs/stream.md they’re pretty nifty, and you can convert them to deferreds and back

lmergen19:05:12

> For any Clojure operation that doesn’t have an equivalent in manifold.stream, we can use manifold.stream/transform with a transducer: