Interrupt `clj` evaluation without exiting REPL

@joinr That makes a lot of sense! I’ve been thinking that I should probably clean up the channels I set going, or at least have a kill switch of sorts. I’m lead to think of Component and Integrant, which let you handle and reload resources, in the same way that you might want to be able to close your channels in order to keep working on them.

I skimmed the source you linked to. If you have the time, I’d appreciate a usage example! For instance, do I need to create channels a special way in order to be able to tear them all down?

@madbonkey I believe @alexmiller is referring to the clj CLI app. Intellij does a little magic itself, so it doesn’t rely directly on the CLI interface. CIDER (Emacs) lets you do this as well, with M-x cider-interrupt. It’s not that It’s impossible to interrupt an evaluation, but when C-c interrupts the program, one would need another signal to interrupt (just) an expression evaluation. And I think that’s just not implemented as per today.

I started out working with CIDER, but because I did’t know all that well what I was doing, I ended up queuing up a bunch of blocking calls. Then I would have to M-x cider-interrupt a bunch of times to regain control. Using a “normal” REPL like clj was a little simpler, because it was very clear when I was blocking and when I was not.

1 Like