-
-
Notifications
You must be signed in to change notification settings - Fork 180
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
How to check my parent and child process executed in parrallel?? #107
Comments
Please take a look at #97, carefully read the README: https://github.com/spatie/async/blob/master/README.md , and come back if it's still not clear after reading that. |
am confused..can you explain How to check my parent and child process executed in parrallel?? |
Have you read up on how this package works? |
Yeah but able to find some little codes :( can u give a link or explain the parent child process?? |
Maybe this can be of help: https://stitcher.io/blog/asynchronous-php I'm sorry but I don't have the time to explain the core ideas of async programming in PHP, but I'm sure you can find some good literature online. |
Thank you Brendt, if you have time please try to provide codes with some examples in documentation surely it will make this package more good. |
It will be hard for him to produce the examples. What seems to be missing is the fact, this package as laid out is not standalone. When this package calls As commented #98 the Anyway, I extracted and reworked various parts of this package into a bigger package. The heart symplely/processor is the wrapper API for symfony/process, forked and renamed from PR. What is Async? see https://symplely.github.io/coroutine/ For examples see https://github.com/symplely/coroutine/tree/master/examples, |
use Spatie\Async\Pool;
public function save(){
//my parent function goes
//my child process starts
$pool[] = async(function () use($data) {
sleep(3);
})->then(function ($output) {
})->catch(function ($exception) {
});
await($pool);
sleep(3);
}
To check I included sleep(3) in both parent and child process and it takes 6 seconds but i think this was not correct because if it was executed in parallel means it has to take only 3 seconds. Please guide me for this issue.
The text was updated successfully, but these errors were encountered: