-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat(notifications): provide method to preload many notifications at once #54232
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
Conversation
| * improve performance by, for example, bundling SQL queries. | ||
| */ | ||
| #[Implementable(since: '32.0.0')] | ||
| interface IPreloadableNotifier extends INotifier { |
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.
We should deprecate INotifier (but can also wait one release), to make developers more aware of the performance related improvement
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.
I would rather integrate the method into the actual interface rather than deprecating it. Otherwise, Psalm will complain all the time about INotifier being deprecated and we will end up with IPreloadableNotifier becoming the base interface at some point which sounds weird.
I added a hint to INotifier though to make developers aware.
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.
Well we can not extend the base interface due to our policies
And deprecating the other one would help via psalm and IDEs that was exactly my idea to it.
If an app doesn't care they can implement the interface and do nothing in the method, but get easily rid of the deprecation?
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.
I'd vote for keeping the old interface as-is because the usage is not always problematic. With documentation (manual, code in-line) we can get attention to the extending interface for apps where preloading makes sense.
ChristophWurst
left a comment
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.
Looks good
| * improve performance by, for example, bundling SQL queries. | ||
| */ | ||
| #[Implementable(since: '32.0.0')] | ||
| interface IPreloadableNotifier extends INotifier { |
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.
I'd vote for keeping the old interface as-is because the usage is not always problematic. With documentation (manual, code in-line) we can get attention to the extending interface for apps where preloading makes sense.
…once Signed-off-by: Richard Steinmetz <[email protected]>
a2fb8d9 to
ad39dab
Compare
ChristophWurst
left a comment
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.
![]()
|
|
INotifier::preloadMany()to allow implementations to preload and cache data for many notifications at once #54231Summary
Allow notifier implementations to preload and cache data for many notifications at once to improve performance by, for example, bundling SQL queries.
Checklist