Arc Forumnew | comments | leaders | submitlogin
2 points by marcos 6135 days ago | link | parent

actually, i must be dense, but when y'll run arc instances are you doing something like

  mzscheme -m -f as.scm
  (nsv 8080)
or are you running it differently so that you can pop it into the background? i get lots of timeout errors from doing this... thanks.


4 points by sacado 6135 days ago | link

What do you mean by "pop into the background" ? There are 2 ways to achieve this :

  (thread (nsv 8080))
This one gets you back to the REPL, so that you can maintain your app as it is running.

  mzscheme -m -f as.scm < script.arc &
This one (under Unix) runs the script and gives you back to the prompt, while your server is running.

What kind of errors do you get ?

-----

1 point by antiismist 6133 days ago | link

Is there a standard graceful way of stopping a background process?

I could: launch nsv as a thread in the background, then fg it back, then use (quit) in the repl. But is there a better way to do this? Does (quit) shut down the server gracefully?

-----

3 points by almkglor 6133 days ago | link

(quit) shuts down gracefully AFAIK. If you're not confident of it, use (= quitsrv* t) and make one request from the server.

-----

1 point by marcos 6135 days ago | link

upon further reading through the forum, i figured out that the timeouts were a side-effect of the 'date problem' but because i hadn't been quick on the uptake, i had no idea that was what i was even looking for.

moving to anarki/arc-wiki stable fixed that. thanks for putting up with me, everyone!! :)

-----

1 point by marcos 6135 days ago | link

you are my hero, i hadn't seen the thread procedure documented in the tutorial.

the problem manifests itself as either 502 errors (served via mod_proxy_balancer) or "server dropped the connection" errors, but the thread business helps immensely.

-----

1 point by antiismist 6134 days ago | link

As far as I know there are three ways to run nsv in the "background":

1. via (thread...)

2. via &

3. via a detatched screen

(I like to use this because my server is remote so I can set up something, detatch, disconnect, and log back in later and reattach)

So what I use is a detatched screen and (thread ...)

-----