tonsky / Clojure-Sublimed

Clojure support for Sublime Text 4
MIT License
359 stars 22 forks source link

Middleware to clone & eval in a single command #20

Closed tonsky closed 2 years ago

tonsky commented 2 years ago

Reduces network latency and change of errors

jaihindhreddy commented 2 years ago

If the intent of this is only to avoid the additional network roundtrip, then we can simply use nREPL's ephemeral sessions to do the job. This approach is implemented by #48. That being said, I did implement the other approach suggested by the literal text of the issue i.e, implementing a clone-and-eval middleware. This is implemented by #49.

Using Ephemeral sessions has a couple of advantages IMO:

  1. Less code to make it happen (using the existing Ephemeral sessions code already provided by nREPL)
  2. The one-off sessions are cleaned up (closed). Currently, an unbounded number of threads are created in the nREPL server. This could be addresses by closing the session ourselves, but the code currently does not do this (discussed separately in #50).

WDYT?

tonsky commented 2 years ago

Thanks! I’ll take a look after the holidays

jaihindhreddy commented 2 years ago

Of course! Have fun!