Fork me on GitHub

I recently saw someone post about a workflow/library that could save your repl history as tests or something like that. I cant find that link anywhere, does someone here know of something like that?


Awesome thanks!!


After spending the weekend wrapping my head around sente, I have one question which remains: * As far as I understand it, authentication state is read from the ring map, specifically here: {:session {:uid :some-uid-val}} * So, e.g. to login a user, the user has to post a rest api request to some endpoint which then sets a key there, i.e. (assoc-in response [:session :uid] :some-uid) * Then, the client has to reconnect So far, this works. But this seems to be the only mechanism to differentiate between users. Say I have a not-logged-in (anonymous) user connected. Unsurprisingly, I’ll have:

(:any @connected-uids)
;; => #{taoensso.sente/nil-uid}
Now, another anonymous user connects from a different computer. I still have:
(:any @connected-uids)
;; => #{taoensso.sente/nil-uid}
Where’s the other one? Are both users simply grouped as “nil-uid” users and I can’t sent them specific messages? Say, User 1 wants to subscribe to updates of cat videos while User 2 is more interested in dog videos. Phoenix / Elixir solves this by having some server-side state for each websocket connection, this seems not to be the case here. Am I missing anything?


I haven’t used Sente properly, but when I tried it out, I got the impression that it’s maybe trying to handle a bit too much for me.

☝️ 4

@olieidel you need to give anonymous users some form of id to distinguish them, such as a UUID


In the session then, right? This will mean that users will have to reconnect after they've been assigned a uuid, is that correct?


Seems a bit clunky to make all users connect twice but I can't think of another solution


you can set the uuid on the client side IIRC, haven’t used Sente in a long while


let me see if I can dig up some code


I’m sure you don’t have to connect twice, but I can’t remember exactly how to do it either, sorry 😕


ahh I think I got it! thanks for that post, I remember having looked at it but I kinda skipped the examples below which are actually way more helpful. I’ll give it a go when I find some time in the next few days. Thanks a lot for your help! 🙂


as I recall from my sente usage, the frontend can specify an id it should use (so as a known user they can know their id and present it and that should implicity be a login flow if they don't have a valid session...)


Hi, how to read Clojure's Source? Could someone advise a guide?


if you’re interested in the standard library, take a look at core.clj


if you wanna check out the compiler, start with and


I know where source is, thanks for that. I would like to understand how the clojure.main works. Looks difficult to start...


AFAIK noone has written an easy-to-read guide to Clojure’s internals, so if you want to know you’re gonna have to dive right in and spend some time


I suggest starting with the files I mentioned above, if you get stuck on something just ask here 🙂


are you familiar with Java bytecode and/or ASM?


not yet 🙂


then that is a good thing to begin with!


I found it extremely helpful to use and disassemble small functions in the REPL


Hi all, I have a bunch of counters in the form of [#inst "2018-03-23" 3] [#inst "2018-03-27" -1], I’d like to generate a rolling sum where for each instant, the sum is the instant’s value plus all values before. I would prefer to use an efficient solution, memoize comes to mind but I’m guessing there’s a smarter way to do it




wow I knew there was something like that


Has anyone successfully sent email with clojure in a Windows environment? I've been struggling with the Postal library. I'm able to successfully send mail using the same port, smtp server (gmail), and credentials with Powershell.


I'm aware that library says "untested on Windows" in the readme, but it seems to be the main clojure library for sending email. Perhaps I'd have better luck using Java directly.


Usually I get a connection timed out exception, just fyi, but depending on settings (like switching to tls instead of ssl), I've gotten other error messages too.


give this issue some support - Insomnia is an awesome REST client

👍 24