What are you really trying to do?
I want to use await function to ensure that activities are completed with or without an errors
Describe the bug
When any activity is completed with error, await function doesn't continue workflow immediately, it waits for the full interval
Minimal Reproduction
foreach ($anticipationPromises as $promise) {
$promise
->then(function() use (&$index) {
$index++;
file_put_contents('/srv/app/ddd.log', time()." success $index\n", FILE_APPEND);
})
->otherwise(function() use (&$index) {
$index++;
file_put_contents('/srv/app/ddd.log', time()." error $index\n", FILE_APPEND);
});
}
file_put_contents('/srv/app/ddd.log', time(). " start awaiting $index\n", FILE_APPEND);
yield \Temporal\Workflow::awaitWithTimeout(
CarbonInterval::seconds(60),
\React\Promise\all($anticipationPromises)
);
file_put_contents('/srv/app/ddd.log', time(). " complete $index\n", FILE_APPEND);
Result when 2 activities have no errors looks good
1708030014 start awaiting 0
1708030016 success 1
1708030018 success 2
1708030018 complete 2
Result when one of the activities has an error looks good (completion takes 60 seconds)
1708030094 start awaiting 0
1708030096 error 1
1708030098 success 2
1708030154 complete 2
Environment/Versions
Additional context
What are you really trying to do?
I want to use await function to ensure that activities are completed with or without an errors
Describe the bug
When any activity is completed with error, await function doesn't continue workflow immediately, it waits for the full interval
Minimal Reproduction
Result when 2 activities have no errors looks good
Result when one of the activities has an error looks good (completion takes 60 seconds)
Environment/Versions
Additional context