funcool

A channel for discussing and asking questions about Funcool libraries https://github.com/funcool/
niwinz 2015-12-01T06:45:40.000021Z

@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

niwinz 2015-12-01T06:46:19.000022Z

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

niwinz 2015-12-01T06:46:55.000023Z

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

sparkofreason 2015-12-01T08:18:42.000024Z

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

sparkofreason 2015-12-01T19:44:07.000025Z

@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.

sparkofreason 2015-12-01T19:47:54.000027Z

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

niwinz 2015-12-01T20:28:03.000028Z

Hmm

niwinz 2015-12-01T20:29:28.000029Z

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

niwinz 2015-12-01T20:46:38.000030Z

I'm not clearly understand the sente abstraction :S

sparkofreason 2015-12-01T20:49:27.000031Z

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

niwinz 2015-12-01T20:51:29.000032Z

maybe, I need more time for research i guess

niwinz 2015-12-01T20:51:58.000033Z

in fact, catacumba can emulate ring

niwinz 2015-12-01T20:52:26.000034Z

and the body can be just a core.async channel

niwinz 2015-12-01T20:52:42.000035Z

the response body I mean

niwinz 2015-12-01T20:53:18.000036Z

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

niwinz 2015-12-01T20:53:22.000037Z

I think...

sparkofreason 2015-12-01T21:08:35.000038Z

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.

niwinz 2015-12-01T21:23:38.000039Z

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

niwinz 2015-12-01T21:23:56.000040Z

ring is not designed to be async

niwinz 2015-12-01T21:25:33.000041Z

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

niwinz 2015-12-01T21:26:14.000042Z

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

niwinz 2015-12-01T21:28:55.000043Z

https://github.com/ptaoussanis/sente/issues/124

sparkofreason 2015-12-01T21:35:33.000045Z

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.

niwinz 2015-12-01T21:36:55.000046Z

nice!

kenny 2015-12-01T22:13:14.000047Z

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

niwinz 2015-12-01T22:19:10.000049Z

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

niwinz 2015-12-01T22:19:47.000050Z

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

niwinz 2015-12-01T22:20:09.000051Z

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

kenny 2015-12-01T22:22:31.000052Z

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.

niwinz 2015-12-01T22:25:51.000053Z

I'm experimenting a little bit in this area

niwinz 2015-12-01T22:26:43.000057Z

this is a documentation of the client (cljs) part

niwinz 2015-12-01T22:26:59.000058Z

the server part is already implemented in catacumba 0.9.0-SNAPSHOT

niwinz 2015-12-01T22:27:44.000061Z

here the documentation of the server part

niwinz 2015-12-01T22:28:01.000062Z

it still uses websocket in server side

niwinz 2015-12-01T22:28:09.000063Z

but uses beicon in client side

kenny 2015-12-01T22:28:27.000064Z

FYI you have a 404 https://funcool.github.io/catacumba/latest/postal.html

niwinz 2015-12-01T22:28:43.000065Z

I know, is devel doc

niwinz 2015-12-01T22:28:51.000066Z

when it will be published the link will work

niwinz 2015-12-01T22:28:58.000067Z

thanks!

niwinz 2015-12-01T22:29:33.000068Z

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

niwinz 2015-12-01T22:29:45.000069Z

that also serves for upgrade to websockets

niwinz 2015-12-01T22:30:13.000070Z

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

kenny 2015-12-01T22:30:50.000071Z

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

niwinz 2015-12-01T22:31:15.000072Z

its is still WIP but is almost done

niwinz 2015-12-01T22:31:49.000073Z

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

niwinz 2015-12-01T22:32:01.000074Z

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

kenny 2015-12-01T22:33:28.000075Z

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

niwinz 2015-12-01T22:34:35.000076Z

Are you using catacumba?

kenny 2015-12-01T22:34:47.000077Z

Yes. I work with @dave.dixon

niwinz 2015-12-01T22:34:58.000078Z

Oh cool!

niwinz 2015-12-01T22:35:23.000079Z

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

kenny 2015-12-01T22:35:38.000081Z

👍

niwinz 2015-12-01T22:38:03.000082Z

\o/ (/me go away)