Hi,

I want to run a subprocess with a timeout. Here’s what I tried:

#lang racket
(require racket/sandbox)

(with-handlers ([exn:fail:resource? (λ (e) (displayln "Timed out"))])
  (with-limits 5 #f (system "sleep 10 && echo Finished")))

This doesn’t work, it prints both “Timed out” after 5 seconds and “Finished” 
after 10 seconds. I wish ‘with-limits’ would stop the underlying process, so 
I’d never see “Finished”. How should I do that?

Thank you.

-- 
Leandro Facchinetti <m...@leafac.com>
https://www.leafac.com

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to