Fork me on GitHub
#editors
<
2018-08-05
>
pez15:08:30

@bozhidar: I have a this stupid limitation in Calva where I can only send one nRepl request at a time. This is because I have so far dodged dealing with message IDs. When looking at this now I took a look at the CIDER code and find this:

(defun nrepl--mark-id-completed (id)
  "Move ID from `nrepl-pending-requests' to `nrepl-completed-requests'.
It is safe to call this function multiple times on the same ID."
  ;; FIXME: This should go away eventually when we get rid of
  ;; pending-request hash table

pez15:08:03

Which got me very curious, since a hash table (well, map of course) was what I had in mind. 😃 Can I read somewhere on what you plan to do instead, or maybe just throw me some bones I can chew on?

dominicm16:08:44

interesting implementation. I don't really track open requests, I send them out, and if they never return then their callback never runs. If I want to timeout I'd probably need to do this though I guess.

👍 4
bozhidar19:08:36

@pez I tracked them mostly to know what to interrupt. Haven’t touched this code in a while, so I don’t recall off the top of my head what did I have in mind as the evolution of the code.

pez19:08:28

Thanks, both of you. Appreciated!

pez19:08:03

Do you guys have to do something special for long/big responses from the nREPL server? I get bencode decode errors and am not sure where it is messed up.

pez19:08:48

What is long/big seems to vary, but evaluating something like (map #(str %) (range 10000)) usually renders me a decode error.

dominicm21:08:18

Which javascript library are you using? I've found bugs in quite a few now.

pez21:08:17

I would like to be using clojurescript libraries, but haven't found any that looks maintained or complete enough. So, yes, using js libraries. bencoder and Buffer are the relevant ones here. I'm actually using the npm Buffer, even though there is one built in to node (which I only realized earlier today).