immutant

http://immutant.org Note: dev discussion happens in #immutant on FreeNode IRC.
timgilbert 2016-08-17T15:20:39.000286Z

Hi all. I'm messing around with websockets some, and I'm wondering what sort of approach people generally take in order to keep track of which users are connected to which sockets

timgilbert 2016-08-17T15:21:31.000287Z

The obvious thing to me would be just to keep an atom and update it with {:user-1 websocket-ch} whenever someone is successfully authenticated

timgilbert 2016-08-17T15:22:32.000288Z

But I'm wondering if there's something built in to immutant that might give me a less "maintain your own atom" kind of interface to it, since immutant/undertow need to maintain a pool of websockets anyways

timgilbert 2016-08-17T15:25:12.000289Z

Parenthetically, the links to the API docs for websockets and the feature demo example for websockets are both broken on this page: http://immutant.org/tutorials/web/

2016-08-17T15:38:51.000290Z

@timgilbert: we don't really provide anything for tracking state like that, other than you putting it into an infinispan cache instead of an atom, which would really only have advantages if you were in a cluster

2016-08-17T15:39:09.000291Z

sente gives you that tracking for free though - have you looked at it?

2016-08-17T15:39:30.000292Z

https://github.com/ptaoussanis/sente

2016-08-17T15:40:59.000294Z

thanks for the report on broken links in that tutorial, but I doubt we'll fix them, since that's old, and we recommend using the guides now: http://immutant.org/documentation/current/apidoc/guide-web.html

2016-08-17T15:43:33.000295Z

@timgilbert: how might we better phrase the text in that box at the top of that page to get you to click on the link to the latest docs?

timgilbert 2016-08-17T15:48:43.000296Z

Oops, I guess I would have had to have read it in order to evaluate the phrasing 😉

timgilbert 2016-08-17T15:49:16.000297Z

I'm pretty sure I got there via google search for "immutant websockets" or something similar

timgilbert 2016-08-17T15:49:31.000298Z

Sorry, PEBKAC

2016-08-17T15:50:15.000299Z

@timgilbert: 🙂

timgilbert 2016-08-17T15:50:21.000300Z

I will take a look at sente, thanks for the pointer. I had sort of assumed it was just a front-end thing, I think

2016-08-17T15:50:53.000301Z

it's front and back end, and handles a lot of the complexity of managing async connections for you

timgilbert 2016-08-17T15:51:18.000302Z

Cool, might be just what I'm looking for