views:

72

answers:

4

I want to start a rather time consuming process using a web interface, so I obviously want it to run in a background (daemon) process and I'd also like to have a progress bar using AJAX or sth like that.

My idea was to have a daemon listening for requests on a given port. The browser would then send a request with the task parameters and the daemon would start the process by running a shell command. It would also have to spawn another thread that would monitor the progress and open another socket to relay this information upon request. I need only one process at a time, so no need for more than one worker thread.

The question I have is, what programming language could I use to write this simple program with least effort. I could of course do it in C, like always, but this time I'm willing to learn something new/better.

+5  A: 

Python is well equipped to do that sort of thing: you have an embeddable HTTP server module readily available, a daemon library too.

For the AJAX interface, XML and JSON libraries are available by default also.

A default install of Python 2.5.x / 2.6.x contains all the modules you seem to require.

jldupont
A: 

You can use C#/.Net and use the HTTPListener class.

Traveling Tech Guy
Should have mentioned: I'm on a Linux server so that's not an option really.
Daniel K
A: 

perl poe is well suited for this

ennuikiller
A: 

Ruby On Rails is definitely suitable for that sort of thing. There are plugins for background jobs as well.

glebm