Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

async not working #2

Closed
asadkhalili opened this issue Nov 1, 2019 · 3 comments
Closed

async not working #2

asadkhalili opened this issue Nov 1, 2019 · 3 comments

Comments

@asadkhalili
Copy link

hi
I use async to run a function for send a event.
this my code:
function myFunction(){ Yii::$app->async->run(function () { $model = new Events(); $model->Call(); }); return 'ok'; }
i want to return 'ok' when process Call(), for test i add 'sleep(5)' in Call() function, but return ok after 5 seconds
sorry for english.

@vuongxuongminh
Copy link
Owner

It only work with pcntl extension enabled. What's your os?

@asadkhalili
Copy link
Author

windows 8.1 and xampp v3.2.2
php 7.1

@vuongxuongminh
Copy link
Owner

On windows it's sync if you deploy server using unix so not care about that when you deploy on your server it will be async.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants