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
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
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
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/
@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
sente gives you that tracking for free though - have you looked at it?
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
@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?
Oops, I guess I would have had to have read it in order to evaluate the phrasing 😉
I'm pretty sure I got there via google search for "immutant websockets" or something similar
Sorry, PEBKAC
@timgilbert: 🙂
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
it's front and back end, and handles a lot of the complexity of managing async connections for you
Cool, might be just what I'm looking for