0

I want to run some function asynchronously on specific events. So I want to call a shell command from my controller. I used ShellDispacher but not working in async. Anyone can please suggest me better way for it?

Actually I want to invoke Third Party APIs in my web app as a background process.

Harsh Patel
  • 446
  • 5
  • 8
  • **https://stackoverflow.com/questions/222414/asynchronous-shell-exec-in-php** – ndm Jun 23 '17 at 17:30
  • @ndm Thank you but I want to do this using cakephp 2.x – Harsh Patel Jun 23 '17 at 17:39
  • Nothing in CakePHP 2.x stops your from invoking the PHP shell execution functions. Read up on [**threading in PHP**](https://stackoverflow.com/questions/209774/does-php-have-threading) if that is what you're asking for. – ndm Jun 23 '17 at 17:55

1 Answers1

0

May be start it on cron? In you controller write special value to memcached or Db. Cron job start each minute and check this special value and start work if it present.

Ivan Bolnikh
  • 742
  • 9
  • 19