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

6
  • 1
    Then go for it! What is your problem/question?! Commented Mar 31, 2015 at 14:47
  • 1
    "but i don't want to use php threading" Then you are probably SOL. Commented Mar 31, 2015 at 14:49
  • 3
    PHP has no support for asynchronous stuff, OTHER than using threads. So if you don't want to use threads, then you can't really do async calls. Commented Mar 31, 2015 at 14:49
  • don't know how to do with out php threading Commented Mar 31, 2015 at 14:49
  • possible duplicate of Asynchronous Function Call in PHP Commented Mar 31, 2015 at 14:59

1 Answer 1

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.

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.