Make repl task store port used in a file in target-path #682

Closed
technomancy opened this Issue Jul 14, 2012 · 4 comments

Projects

None yet

3 participants

@technomancy
Owner

That way further tasks could send code to be evaluated in an already-launched JVM.

@technomancy
Owner
<technomancy> so with this, you could have a `lein deps :inject` task that
      takes a look at the difference between the current running
      nrepl process's classpath and the classpath that takes any
      changes in project.clj into account, and could use
      pomegranate to add them to the running process.
@tpope
Contributor
tpope commented Nov 7, 2012

Would it make sense to delete this file when the repl exits? It would make things a bit simpler for me.

@trptcolin
Collaborator

I'm observing that being the case on lein master: the file is deleted locally on repl exit. (Also reproduced it not getting deleted on lein2-preview10, which I'm assuming is what you're on?)

It looks like there's at least one other edge case here: what if I launch lein repl more than once? Should there be multiple repl-port files? Should they all share automatically (there might be a race in that case, if they launch right around the same time)?

It looks like right now, the last one in wins and overwrites that file.

@tpope
Contributor
tpope commented Nov 7, 2012

You are correct. I tried on preview10, not master. Is there an emoji for shame?

I had wondered about the multiple repl case as well. One file per repl seems infinitely easier to deal with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment