Arc Forumnew | comments | leaders | submitlogin
8 points by CatDancer 6115 days ago | link | parent

Nice! If you don't want to wait five seconds after saving your file, you could stick a call to your reload-check (without the sleep or the loop) in srv.arc at the point a request comes in:

    (def handle-request (s (o life threadlife*))
      (if (len< (pull dead srvthreads*) threadlimit*)
          (let (i o ip) (socket-accept s)
  +         (atomic (reload-check ...))
            (++ requests*)
though of course you wouldn't want to do this on a server that had a lot of requests coming in, since it would do the check on every request.


2 points by byronsalty 6114 days ago | link

Yep this is definitely for dev only.

I found in practice that 5 seconds we fast enough, I would save the file, switch to browser and refresh and it would be there. Of course 5 seconds is the worst case - 2.5 seconds would be the average.

-----