vuongxuongminh/laravel-async

Not work with async

santutu opened this issue · 12 comments

image

image
image

Expect work time is 1second but 2second.
Do you know what do i wrong?

hi
i had this issue. what is the soloution?

Hi @hannanstd, Are you have PCNTL extension?, What's your OS?

@vuongxuongminh
yes it is enabled.
i use ubuntu 20 and apache2 on localhost, nginx on production server.

1

Can you show your running code?

thanks for your help.
2
3

You're welcome, How about posix extension? Are you install it?

i guess the problem.
when is use php -i | grep pcntl it shows support => enabled , but when is use extension_loaded('pcntl') it returns false

that problem was solved by reinstalling pcntl.
but now the results is null.

20

Can you share your code? Like above but loop 20?

yes
21

Maybe an exception have been throw, try to run:

Async::run(function() {


}, [
     'error' => function(\Exception $e) {
        dump($e);
    }
]);

If exception throw, please ensure your package version's latest: composer show vxm/laravel-async

yes. i had an error. the error: "PHP Warning: Module 'pcntl' already loaded in Unknown on line 0

i fixed it and now all things is okey.

i prepared an installation guide for instal PCNTL on ubuntu and hopefull for other users:
https://stackoverflow.com/a/64634134/6937189

thanks alot for yout awesome package.