-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fix clojure-emacs/cider#1320] Do state tracking in a future #255
Conversation
b96d4e7
to
81d8717
Compare
Won't an agent be a better fit for this? |
Is it ok if the function used to update agents in not pure? |
I think you're risking retries when using agents (but we only use the agent from one thread), but if the only IO is reading from disk then that should be fine. |
I think agents never trigger retries, so this should not be a concern. After all people are implementing log systems and things like this using agents. In a transaction an agent won't be executed until the transaction commits, but this is different. |
I'm running some tests here, and it looks like agents do not trigger retries indeed.
This always prints Not a super rigorous test, but it's convinced me. :) |
I'm not on slack but I just looked at the implementation and you guys are indeed right. There are no retries because the agent holds an |
So, it seems we have clarity here. Agent it is! :-) |
Apart from the failing tests the code looks good to me. |
This should fix all lags associated with the new namespace tracking, both the long delay at first connection and the ~1sec lag in the REPL.
4802b1c
to
c46f063
Compare
[Fix clojure-emacs/cider#1320] Do state tracking in a future
This should fix all lags associated with the new namespace tracking,
both the long delay at first connection and the ~1sec lag in the REPL.