-
Notifications
You must be signed in to change notification settings - Fork 438
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
Add support for amp v3 #1084
Add support for amp v3 #1084
Conversation
53c35c1
to
2b8dfdc
Compare
return new TaskResultCollection( | ||
await($futures, $stopOnFailure->cancellation()) | ||
); | ||
} catch (CancelledException $e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any other amp related exceptions I should be worried about?
There might be a shortcut to collect all finished results somewhere in amp instead of doing my own reduce?
*/ | ||
public function handle( | ||
TaskInterface $task, | ||
TaskRunnerContext $runnerContext, | ||
StopOnFailure $stopOnFailure, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently I have to pass down this Cancellation
all over the handlers.
I don't mind, but maybe there is another way?
} | ||
|
||
$currentEnv = $_ENV; | ||
$worker = $this->poolFactory->createShared(); | ||
$execution = $worker->submit( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error handling of the new worker system seems a lot better.
Do I need to take care of some other amp related exceptions?
(see old implementation -> There I needed to wrap a lot of error handling myself)
* | ||
* @implements Task<TResult, TReceive, TSend> | ||
*/ | ||
class SerializedClosureTask implements Task |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This task is rather straight forward, you might want to reconsider supporting it in parallel-functions
for v3 anyways. For now, it's here to stay.
Merging this one for now. |
This PR introduces AMP v3 support.
Since it's quite breaking in both (internal) API as supported PHP versions, this will be released as GrumPHP V2.
An extra pair of eyes is welcome!