1

The java program in question needs to run for a few minutes, write a temporary file and then terminate. So PHP must allow it run in background , instead of the exec way of waiting for that program to terminate.

What is a cross-platform way of doing this?

Jesvin Jose
  • 22,498
  • 32
  • 109
  • 202
  • You mean run a process asynchronously? – Madara's Ghost Mar 02 '12 at 14:36
  • 1
    possible duplicate of [Asynchronous shell exec in PHP](http://stackoverflow.com/questions/222414/asynchronous-shell-exec-in-php) – Madara's Ghost Mar 02 '12 at 14:37
  • can you create a bash script? – Matt K Mar 02 '12 at 14:39
  • Some more information on the program in question would be good. I'd rather let it run with a cronjob and have 'quite recent' data at hand, if this is an option. Or is the waiting time not relevant at all? – Smamatti Mar 02 '12 at 14:39
  • Doesn't appear to be a dup, since the question requires being cross platform and other questions I can find all seem to have *nix specific answers. – acrosman Mar 02 '12 at 14:42
  • @acrosman , thanks for mentioning that for me! Yes, most answers are *nix dependant and we use Linux and Windows for different phases of its life. – Jesvin Jose Mar 02 '12 at 17:57

1 Answers1

0

There are a couple ways. Message Queues would be a great way to handle this.

http://www.rabbitmq.com/ and http://kr.github.com/beanstalkd/

They would allow you to asynchronously execute your java in the background without making the user wait.

dm03514
  • 54,664
  • 18
  • 108
  • 145