Fork me on GitHub
#funcool
<
2015-12-01
>
niwinz06:12:40

@dave.dixon: catacumba is so far more flexible than http-kit and immutant in this aspect. It everything defines in terms of abstractions instread of concrete type. So at this moment you can use different return values for represent the asynchronous http

niwinz06:12:19

the websockets are implemented using core.async channels but them are easily can be implemented using any other abstraction.

niwinz06:12:55

I'll try to take time today for research about it

sparkofreason08:12:42

@niwinz thanks - figuring it out, close to a solution, I think.

sparkofreason19:12:07

@niwinz: sort of have it working for websockets, though I have a feeling I made it harder than it needs to be, pushed code here: https://github.com/sparkofreason/sentecumba. client->server seems to work fine, I'm a little unclear on how to send server->client via websocket. I'm calling the .send method on DefaultWebSocket, and the first message goes, but subsequent ones do not. There's some interaction with sente here. Since .send returns a future, I tried deref'ing that to ensure the message got sent, but it just hangs, so I'm not understanding something about how that works. Also not clear on how the close-after-send? flag is supposed to play into this.

sparkofreason19:12:54

@niwinz: I have a feeling that given catacumba's flexibility, it may almost be easier to implement to key features of sente directly.

niwinz20:12:28

Thank you for your time and the start project, maybe I can get it work.

niwinz20:12:38

I'm not clearly understand the sente abstraction :S

sparkofreason20:12:27

I don't either, but get the feeling there's some impedance mismatch with catacumba's abstractions.

niwinz20:12:29

maybe, I need more time for research i guess

niwinz20:12:58

in fact, catacumba can emulate ring

niwinz20:12:26

and the body can be just a core.async channel

niwinz20:12:42

the response body I mean

niwinz20:12:18

so the abstraction that sente needs is just a core.async channel

niwinz20:12:22

I think...

sparkofreason21:12:35

The make-channel-socket! wires everything together given a "web server adapter", which in turn implements IAsyncNetworkChannelAdapter, really just one function which returns an instance of IAsyncNetworkChannel. sente returns a core.async channel for incoming events, and a function to send events.

niwinz21:12:38

The real problem of sente is that is designed in terms of ring and its current approach of ring for async interfaces

niwinz21:12:56

ring is not designed to be async

niwinz21:12:33

I think that I'll not going to spend more time on understand sente, it seems a very big hack around an spec that does not designed to be async

niwinz21:12:14

and it does not handles properly backpressure because the sente abstraction is not designed with backpressure in mind I think...

sparkofreason21:12:33

Agreed. It was pretty painful to get as far as I did, and it still isn't right. Pretty easy to just work directly with catacumba, and I'll start building in features like back-pressure and reconnect as I go.

kenny22:12:14

@niwinz: Instead of using core.async channels for WS in the client/server, is it worth considering to use something like beicon?

niwinz22:12:10

@kenny: do you aware of some rx library for clojure that handles properly the backpressure?

niwinz22:12:47

in client side using rx/beicon is much more pleasant that using core async...

niwinz22:12:09

but in server side I found core.async right approach but definitively I'm open to other options

kenny22:12:31

I don't know any for Clojure. It would be great to handle events using the same stream abstraction in both the client and the server though.

niwinz22:12:51

I'm experimenting a little bit in this area

niwinz22:12:43

this is a documentation of the client (cljs) part

niwinz22:12:59

the server part is already implemented in catacumba 0.9.0-SNAPSHOT

niwinz22:12:44

here the documentation of the server part

niwinz22:12:01

it still uses websocket in server side

niwinz22:12:09

but uses beicon in client side

niwinz22:12:43

I know, is devel doc

niwinz22:12:51

when it will be published the link will work

niwinz22:12:33

The postal serves for build relay like endpoints on top of http

niwinz22:12:45

that also serves for upgrade to websockets

niwinz22:12:13

and just use stream abstraction in client side for both receive and send data to the server

kenny22:12:50

That sounds great! I'm reading about it now 😄

niwinz22:12:15

its is still WIP but is almost done

niwinz22:12:49

It need some polishing and I'm pretty sure I will have it done in some days, ready for catacumba 0.9.0

niwinz22:12:01

if you have any feedback, it will be very welcome!

kenny22:12:28

Perfect timing for us. And definitely will give you any feedback after reading the docs and code!

niwinz22:12:35

Are you using catacumba?

kenny22:12:47

Yes. I work with @dave.dixon

niwinz22:12:23

If you have any trouble of need some help, contact me without any problem!

niwinz22:12:03

\o/ (/me go away)