开发者

Connecting to a remote instance of Clojure

开发者 https://www.devze.com 2023-01-27 13:22 出处:网络
I read that is possible to connect to a remote, production instance开发者_StackOverflow of Clojure via the REPL.

I read that is possible to connect to a remote, production instance开发者_StackOverflow of Clojure via the REPL.

Would you please explain this to me? and how to do it?

What "instance of Clojure" means?


For REPL specifically, you can use swank-clojure library. Once your clojure application is up and running and has a swank server running in it, you can connect to it from emacs editor using its package called SLIME.

There's also NetBeans IDE plugin enclojure that has exactly the same functionality. It has a server part, which you include and run in your clojure application, and it has a client part which connects to it from NetBeans.


I think you want use clojure.contrib.server-socket. I haven't used it, so I can't comment beyond the reference. There are examples on the clojuredocs site.


The next release of clojure-mode for Emacs will make it very simple to connect to remote swank-clojure instances securely over a ssh tunnel. All you'll need to do is open a file from your remote project via Emacs' tramp and then call clojure-jack-in. It will start a remote swank process, create the tunnel and connect Emacs/slime.

This isn't quite the same as what you're asking as it will start a new process rather than connecting to the existing production process. However, your swank process will be in the same environment otherwise and it's probably safer to do it this way rather than risk crashing a live production process.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号