-
Notifications
You must be signed in to change notification settings - Fork 124
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
Events triggering refactor #1308
Conversation
…et-kuzzle-emit-events
Codecov Report
@@ Coverage Diff @@
## 1-dev #1308 +/- ##
=========================================
+ Coverage 93.69% 93.7% +0.01%
=========================================
Files 98 98
Lines 6934 6930 -4
=========================================
- Hits 6497 6494 -3
+ Misses 437 436 -1
Continue to review full report at Codecov.
|
SonarQube analysis reported 1 issue Note: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:
|
Release 1.8.0 Bug fixes [ #1311 ] Fix promise leaks (scottinet) [ #1298 ] Fix disabled protocol initialization (Aschen) [ #1297 ] Fix timeouts on plugin action returing the request (benoitvidis) [ #1288 ] Fix an error when trying a non-partial bulk update (scottinet) [ #1286 ] Allows bulk inserts on aliases (benoitvidis) [ #1282 ] Scan keys on redis cluster (benoitvidis) [ #1279 ] Users must be authenticated to use auth:logout (scottinet) New features [ #1315 ] Add the new Vault module to handle encrypted application secrets (Aschen) [ #1302 ] Add write and mWrite (Aschen) [ #1305 ] Add pipes & hooks wildcard event (thomasarbona) Enhancements [ #1318 ] Add a maximum ttl to auth:login (benoitvidis) [ #1301 ] Upgrade the WebSocket libraries (scottinet) [ #1308 ] Events triggering refactor (scottinet) [ #1300 ] Collection specifications methods cloisoned to a collection (thomasarbona) [ #1295 ] Improve validation error messages (benoitvidis) [ #1292 ] Throw an error when the realtime controller is invoked by plugin developers (benoitvidis) [ #1257 ] Add ability to define mapping policy for new fields (Aschen) [ #1291 ] Fix --help on subcommands (Yoann-Abbes) [ #1289 ] Handle ping/pong packets (scottinet) [ #1273 ] Fix incomplete access logs (scottinet) Others [ #1317 ] Add ps dependency to plugin-dev Docker image for pm2 (benoitvidis) [ #1312 ] Check that .kuzzlerc.sample is well-formed (scottinet) [ #1299 ] Add Kuzzle Nightly & Redis 3 and 4 test (alexandrebouthinon)
Description
Do not be afraid by the seemingly large number of changed lines, this PR is more simple than it appears.
All it does is this:
kuzzle
object, as an event emitter, trigger events itself (separation of concern)pluginsManager.trigger
method working for both hooks (simple event emissions) and pipes (awaited events returning promises, listened by plugins), we now have the standardkuzzle.emit
method (synchronous, events are non-blocking), and the newkuzzle.pipe
one (async, promise-based, awaited by kuzzle)So, a little bit of code... and a looooooooooot of
kuzzle.pluginsManager.trigger
changed into eitherkuzzle.emit
orkuzzle.pipe
.Expected benefits:
kuzzle
as an event emitter, but with events triggered only by using thepluginsManager
objectOther changes
validation:error
hook: it isn't documented, and I couldn't find a use for itHow to review
I suggest that you concentrate on reviewing the modifications made to the
lib/kuzzle.js
andlib/api/core/plugins/pluginsManager.js
files.Apart from unit tests updates, all other changes are anecdotical (but it's up to you obviously)