Upgrade react/promise to v3 and react/event-loop to v1.6#3043
Open
Upgrade react/promise to v3 and react/event-loop to v1.6#3043
react/promise to v3 and react/event-loop to v1.6#3043Conversation
`PromiseInterface` now includes the functionality `ExtendedPromiseInterface`. Additionally use imports instead of FQN. Ref: https://github.com/reactphp/promise/releases/tag/v3.0.0
Both now require an explicit value argument. Ref: https://github.com/reactphp/promise/releases/tag/v3.0.0
`reject()` now requires a `Throwable` instance as argument. Ref: https://github.com/reactphp/promise/releases/tag/v3.0.0
These methods have been renamed in v3. Ref: https://github.com/reactphp/promise/releases/tag/v3.0.0
Update `@var` annotation to use `PromiseInterface[]`. Remove now unused `Promise` import from JobRunner.
`React\EventLoop\Factory` has been removed in v1.2. The replacement is `React\EventLoop\Loop::get()` which returns a shared loop instance. Ref: https://github.com/reactphp/event-loop/releases/tag/v1.2.0
`FinishedProcessState` does not implement `\Throwable`, so `catch(function (FinishedProcessState $state))` can never trigger in react/promise v3 where rejection reasons must be `\Throwable`. This is safe to remove because `IcingaCli` already rejects with an `Exception` wrapping the process state reason: ```php $deferred->reject(new Exception($state->getReason())); ``` The existing `catch(\Exception $e)` handler already covers this. Ref: https://github.com/reactphp/promise/releases/tag/v3.0.0
react/promise to **v3** and react/event-loop to **v1.6**react/promise to v3 and react/event-loop to v1.6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
react/promiseto v3:ExtendedPromiseInterfacewithPromiseInterfaceresolve()andreject()otherwise()/always()tocatch()/finally()FinishedProcessStatecatch handler that can never trigger in v3 (because it doesn't implement theThrowableinterface);gipfl\IcingaCliDaemon\IcingaClialready rejects with an Exception wrapping the process state reasonreact/event-loopto v1.6:Factory::create()withLoop::get()References
https://github.com/reactphp/promise/releases/tag/v3.0.0
https://github.com/reactphp/event-loop/releases/tag/v1.2.0