Fork me on GitHub
#leiningen
<
2016-06-23
>
chrisetheridge10:06:51

is it possible to run a function before a lein repl then one after it has finished compiling and has started?

darwin11:06:02

@biscuitpants: you can specify :repl-options > :init a form which is executed before lein repl starts

darwin11:06:47

running code after repl actually started is more tricky

darwin11:06:36

I ended up spawning code in a separate thread in my :init and wait until REPL comes online by polling its state: https://github.com/binaryage/dirac/blob/master/src/agent/dirac/agent_impl.clj#L140

darwin11:06:13

there might be better solution of course, but this was the best I was able to do

chrisetheridge12:06:01

ah i see, thank you @darwin, that helps a lot

chrisetheridge12:06:08

:init form would help a lot

chrisetheridge12:06:16

but also seeing that it may be easier with boot instead of lein

chrisetheridge12:06:25

but, none of my projects are made with boot, so its tricky