@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
the websockets are implemented using core.async channels but them are easily can be implemented using any other abstraction.
I'll try to take time today for research about it
@niwinz thanks - figuring it out, close to a solution, I think.
@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.
@niwinz: I have a feeling that given catacumba's flexibility, it may almost be easier to implement to key features of sente directly.
Hmm
Thank you for your time and the start project, maybe I can get it work.
I'm not clearly understand the sente abstraction :S
I don't either, but get the feeling there's some impedance mismatch with catacumba's abstractions.
maybe, I need more time for research i guess
in fact, catacumba can emulate ring
and the body can be just a core.async channel
the response body I mean
so the abstraction that sente needs is just a core.async channel
I think...
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.
The real problem of sente is that is designed in terms of ring and its current approach of ring for async interfaces
ring is not designed to be async
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
and it does not handles properly backpressure because the sente abstraction is not designed with backpressure in mind I think...
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.
nice!
@niwinz: Instead of using core.async channels for WS in the client/server, is it worth considering to use something like beicon?
@kenny: do you aware of some rx library for clojure that handles properly the backpressure?
in client side using rx/beicon is much more pleasant that using core async...
but in server side I found core.async right approach but definitively I'm open to other options
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.
I'm experimenting a little bit in this area
https://github.com/funcool/postal/blob/master/doc/content.adoc
this is a documentation of the client (cljs) part
the server part is already implemented in catacumba 0.9.0-SNAPSHOT
https://github.com/funcool/catacumba/blob/master/doc/content.adoc#postal
here the documentation of the server part
it still uses websocket in server side
but uses beicon in client side
FYI you have a 404 https://funcool.github.io/catacumba/latest/postal.html
I know, is devel doc
when it will be published the link will work
thanks!
The postal serves for build relay like endpoints on top of http
that also serves for upgrade to websockets
and just use stream abstraction in client side for both receive and send data to the server
That sounds great! I'm reading about it now 😄
its is still WIP but is almost done
It need some polishing and I'm pretty sure I will have it done in some days, ready for catacumba 0.9.0
if you have any feedback, it will be very welcome!
Perfect timing for us. And definitely will give you any feedback after reading the docs and code!
Are you using catacumba?
Yes. I work with @dave.dixon
Oh cool!
If you have any trouble of need some help, contact me without any problem!
👍
\o/ (/me go away)