Fork me on GitHub
#calva
<
2021-05-18
>
pez06:05:30

A humble reminder for Calva friends: Please consider subscribing to the CalvaTV Youtube channel. https://www.youtube.com/c/CalvaTV/

📺 15
calva 20
❤️ 9
pez11:05:28

I see what you did there, @UJZ6S8YR2!

😁 3
Fahd El Mazouni14:05:45

Hello everyone ! I'm kind of stuck and my googling skills seem to be lacking... Is there a way to configure evaluation timeout in calva ? I'm trying to evaluate a form in a cljs repl

pez14:05:01

There is no such config. Maybe you can wrap the evaluations in something that times out? And then use custom repl commands to wrap it. https://calva.io/custom-commands/

Fahd El Mazouni14:05:53

that's the thing I kind of don't want it to time out, you think I can manage to launch my evaluation in the background and have it run something once it's done to print the result ?

Fahd El Mazouni14:05:07

(sorry btw full disclosure I'm a clojure beginner)

pez14:05:49

So it times out?

Fahd El Mazouni14:05:23

yes it does ! I wanted to configure it out of existence 😛

Fahd El Mazouni15:05:54

https://github.com/clojure-emacs/cider/issues/2616 I found this, but it's cider specific, and I can't find much in nrepl docs

pez15:05:31

I also found that one 😃 Seems it is possible in CIDER so maybe it is something we should support in Calva. Also there is talk there about async and sync calls, which I don’t quite follow…

pez15:05:00

Maybe @U051BLM8F can shed some light on it for me.

Fahd El Mazouni15:05:40

https://github.com/BetterThanTomorrow/calva/blob/a1afb5799bc8f1e4063badb8964f462b1da7dfcc/src/nrepl/index.ts#L289 this is the function that gets called to evaluate any code "selection" ? and I couldn't find any mention of "Eval timed out!" so I guess it must be coming from nrepl ?

bozhidar15:05:42

There's no sync requests in nREPL, but Emacs doesn't handle async APIs well and I have implemented a simulation of sync requests - basically a function that waits for a response.

bozhidar15:05:20

That's dangerous, though, as it can lock-up the client that's why there's also some timeout associated with it. At any rate - that's just Emacs stuff that you can disregard completely.

pez15:05:08

I see. So this timeout @U9W44J4RW gets is happening in ClojureScript?

bozhidar15:05:52

It must be. It's certainly not happening in nREPL.

pez15:05:07

My google fu fails me, but at least now I know where to ask. Thanks for your super high service level, @U051BLM8F! ❤️

3
pez15:05:26

Good find, @U9W44J4RW! Doesn’t look all that configurable, though…

Fahd El Mazouni15:05:30

thanks guys ! got the answer thanks to you !

pez15:05:08

Actually yes, I read it sloppily.

pez14:05:14

Tell us a bit more about what it is you want to do. Maybe we can figure something out together, or maybe we will realize that we need an issue to track a feature request.