[Cialug] Starting two jobs at once

jim kraai jimgkraai at gmail.com
Tue Nov 27 15:38:41 CST 2012


node might be a great tool for this

If I were to write this from scratch, and since you're already using
python, I'd look into twisted reactor and writing/scheduling resource
watcherdogs.  i'm sure there's much better terminology, but this is one way
of doing it all in user space.

Of course, it's possible I've completely missed the point of the question.
 Apologies if that's the case.



On Tue, Nov 27, 2012 at 2:35 PM, Matthew Nuzum <newz at bearfruit.org> wrote:

> Hi, in order to make development on projects easier I often automate
> common tasks with Makefiles. For example, a common work flow for a Python
> project is:
>
> git clone project
> cd project
> make
> make run
>
> The makefile will generate a virtualenv, install project dependencies and
> create initial configuration files. Make run will start a temporary web
> server and keep it running so that I can work on the code and view the
> project in my browser.
>
> As it turns out, some of my projects are getting more complex because
> instead of just launching a web server they might also need to launch more
> than one process to serve an app.
>
> For example, I might need to run mongodb and the Django development
> server. I don't care about the output of mongodb, but I would like to see
> the output of the Django dev server. Or possibly want to run sass and have
> it watch files, compiling them whenever they change, and also run a nodejs
> app to serve content. Ideally, when I hit ctrl+c everything shuts down
> orderly.
>
> Any suggestions on how to keep things simple and run a couple tasks at
> once?
>
> Here is a simple example of a Makefile I use:
>
> PIP=env/bin/pip
> MANAGE=env/bin/python ./manage.py
>
> all: build syncdb
>
> syncdb:
>         $(MANAGE) syncdb --noinput
>         $(MANAGE) migrate
>
> build:
>         $(PIP) install -r requirements.txt
>
> run:
>         $(MANAGE) runserver 0.0.0.0:8000
>
>
> --
> Matthew Nuzum
> newz2000 on freenode, skype, linkedin and twitter
>
> ♫ You're never fully dressed without a smile! ♫
>
>
>
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug
>
>


More information about the Cialug mailing list