0

I have a dashboard and I want a process to run when the user clicks on a button. That process might take a long time to complete.

My options so far:

  1. using popen or something similar to execute the process
  2. having a daemon monitor a directory. When this directory is changed (a file created) the daemon will do the job and then delete the file before idling again.
  3. using cron, running every 5 seconds and also monitoring some directory.

Which one is more Linux-friendly? Is there any I have not considered?

2
  • 1
    celery Commented Aug 22, 2012 at 18:32
  • Looks promising, but a bit overkilling in this case. Commented Aug 22, 2012 at 18:35

2 Answers 2

1

This is what task queueing systems like Celery and Redis Queue are for.

Sign up to request clarification or add additional context in comments.

Comments

1

Another option is to have a daemon (as in your 2nd option) that listen on some socket. Then, your WSGI application could just connect & send a command. There are many possibilities for how the communication over the socket would take place, choosing the right one depends a lot on the actual case.

This have the advantage that you can eventually have the two application (WSGI and the daemon) run on different computers or VMs at some point.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.