Coder Social home page Coder Social logo

Comments (5)

trptcolin avatar trptcolin commented on June 30, 2024

Which version of reply are you using? This was a bug fixed in 0.4.4 - details in #199

from reply.

stefan-toubia avatar stefan-toubia commented on June 30, 2024

Oh! I'm on 0.4.3, thanks!

While I have you here, I've been trying to work reply into my workflow with calva. Right now if I start a standalone nrepl, nrepl automatically chooses a port and exposes a port you can connect to, as well as making an .nrepl-port file.

nREPL server started on port 60959 on host localhost - nrepl://localhost:60959

I may have missed this but I did not see how to mimic this when using reply, is this supported?

from reply.

trptcolin avatar trptcolin commented on June 30, 2024

Hmm, lein trampoline run does use nREPL by default, and picks a random port. And then lein trampoline run --attach PORT_NUMBER will let you attach to the same runtime.

I'm not sure there's currently a way to get that generated port number other than (a) doing the thing I did, where you lsof -nPi | grep java and find the exposed port, or (b) if you're in the runtime, looking at (:port @reply.eval-modes.nrepl/nrepl-server). Details:

(defn get-connection [{:keys [attach host port scheme]
:or {scheme "nrepl"}}]
(let [server (when-not attach
(nrepl.server/start-server
:port (when port
(-> port str Integer/parseInt))))
port (when-not attach
(:port server))
url (url-for attach host port scheme)]
(when server
(reset! nrepl-server server))
(when (-> url java.net.URI. .getScheme .toLowerCase #{"http" "https"})
(load-drawbridge))
(nrepl/url-connect url)))

I don't think I'd want us to write an .nrepl-port file explicitly, since that naming responsibility seems like it belongs all together wherever it lives (sounds like in the nREPL codebase), but I'm open to having some config where you could tell REPLy something like --write-port-file "path/to/file"? I'd defer to @bbatsov though.

from reply.

trptcolin avatar trptcolin commented on June 30, 2024

I'm going to go ahead & close this issue - feel free to open another (or a PR!) if the above answer doesn't get you what you need for connecting to a port!

from reply.

stefan-toubia avatar stefan-toubia commented on June 30, 2024

Thanks again for the help!

from reply.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.