0

I have a php function and i want it to work asynchronously.

function my_function1(){
//some code
my_async_func();

}

function my_async_func(){
// doing background task

}

any help is most welcome

i have visited PHP threading call to a php function asynchronously

but i don't want to use php threading

Community
  • 1
  • 1
Lucifer
  • 516
  • 1
  • 6
  • 25

1 Answers1

1

You can't, php is not meant to work that way.

You can run a separate background process, which checks database for jobs to be done and does them. But that is not true async. It's just a background worker.

Mārtiņš Briedis
  • 17,396
  • 5
  • 54
  • 76