Giter Club home page Giter Club logo

Comments (9)

thecontinium avatar thecontinium commented on May 15, 2024 7

FYI this works ( you might want to add to the readme at some point )

With a ~/.lein/profiles.clj of :

{:repl { :repl-options { :init (clojure.core.server/start-server {:accept 'clojure.core.server/io-prepl :address "localhost" :port 55555 :name "lein"})} } }

and conjure.edn of
{:conns { :lein {:port 55555 }}}

makes conjure evals ( connected to 55555 in this case) to be available in the lein nrepl.

from conjure.

Olical avatar Olical commented on May 15, 2024

Yep, the tool you use to start your program doesn't matter, prepl support is tied to Clojure, not the CLI.

You'll just have to start the prepl from your code like I show in my prepl cookbook post: https://oli.me.uk/2019-03-22-clojure-socket-prepl-cookbook/#from_your_code

If you know how to set JVM args with leiningen, then you will be able to start a prepl by defining the following flag.

-Dclojure.server.myprepl="{:port 5555 :accept clojure.core.server/io-prepl}"

There's not much to it 😄 I hope this helps!

from conjure.

Olical avatar Olical commented on May 15, 2024

I didn't really read the issue properly, I was a little distracted. My comment is still valid, but to elaborate on that: You can't connect to a lein repl because that's an nREPL server, not a socket prepl. The post I linked will show you how to start a socket prepl.

from conjure.

thecontinium avatar thecontinium commented on May 15, 2024

Thanks for the additional information.

When I add:

{repl: {:jvm-opts ["-Dclojure.server.myprepl=\"{:port 55555 :accept clojure.core.server/io-prepl}\""] }}

to profiles.clj

I get:

lein repl
Exception in thread "main" java.lang.ExceptionInInitializerError
at clojure.main.(main.java:20)
Caused by: java.lang.ClassCastException: class java.lang.Character cannot be cast to class java.util.Map$Entry (java.lang.Character and java.util.Map$Entry are in module java.base of loader 'bootstrap')
at clojure.lang.APersistentMap.cons(APersistentMap.java:42)
at clojure.lang.RT.conj(RT.java:673)
at clojure.core$conj__5375.invokeStatic(core.clj:85)
at clojure.core$merge$fn__5943.invoke(core.clj:3049)
at clojure.core$reduce1.invokeStatic(core.clj:944)
at clojure.core$reduce1.invokeStatic(core.clj:934)
at clojure.core$merge.invokeStatic(core.clj:3048)
at clojure.core.server$parse_props$fn__8892.invoke(server.clj:152)
at clojure.core.protocols$naive_seq_reduce.invokeStatic(protocols.clj:62)
at clojure.core.protocols$interface_or_naive_reduce.invokeStatic(protocols.clj:72)
at clojure.core.protocols$fn__8144.invokeStatic(protocols.clj:169)
at clojure.core.protocols$fn__8144.invoke(protocols.clj:124)
at clojure.core.protocols$fn__8099$G__8094__8108.invoke(protocols.clj:19)
at clojure.core.protocols$seq_reduce.invokeStatic(protocols.clj:31)
at clojure.core.protocols$fn__8121.invokeStatic(protocols.clj:75)
at clojure.core.protocols$fn__8121.invoke(protocols.clj:75)
at clojure.core.protocols$fn__8073$G__8068__8086.invoke(protocols.clj:13)
at clojure.core$reduce.invokeStatic(core.clj:6828)
at clojure.core.server$parse_props.invokeStatic(server.clj:146)
at clojure.core.server$start_servers.invokeStatic(server.clj:157)
at clojure.core.server$start_servers.invoke(server.clj:157)
at clojure.lang.Var.invoke(Var.java:384)
at clojure.lang.RT.doInit(RT.java:492)
at clojure.lang.RT.(RT.java:338)
... 1 more
Subprocess failed

Ant ideas ?

from conjure.

Olical avatar Olical commented on May 15, 2024

Hmm, not sure right now but that repl: doesn't look quite right to me. Maybe :repl?

from conjure.

Olical avatar Olical commented on May 15, 2024

Glad you got it working! I'll bear this in mind, could add it to my socket prepl cookbook post too.

from conjure.

thecontinium avatar thecontinium commented on May 15, 2024

from conjure.

mn-dimension avatar mn-dimension commented on May 15, 2024

would be good if there was a way of getting the port number from profiles.clj in conjure.edn like you can for a single port value in a file.

from conjure.

Olical avatar Olical commented on May 15, 2024

Hmm, if it's in the profiles.clj file it's a known value though, it's static. So you can just set that in your .conjure.edn anyway, the slurping only really exists for random ports that are spat out into a file by convention.

I'd rather not introduce any more mechanisms if I can help it, static files where you can read more EDN should be enough for almost every case. I think.

from conjure.

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.