Keeping Julia alive while running a web server in the background

Three completely different responses, all useful. Thanks guys! Based on @jballanc’s last suggestion I came up with this simple hack:

nohup julia -e 'using MyApp; @sync startserver()' &

I believe that should be enough to force the server to run synchronously, despite all the @async calls in the underlying packages. It seems to be running as intended, with negligible CPU usage when not responding to a request.

Am I correct? Is this a very bad idea in some other way?

4 Likes