-
Notifications
You must be signed in to change notification settings - Fork 41
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
Close queue #16
Close queue #16
Conversation
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 also expose this if an instance is passed in.
boot.js
Outdated
Boot.prototype.onClose = function (func) { | ||
this._closeQ.push(func, err => { | ||
if (err) this._error = err | ||
}) |
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 think we should call unshift()
here. More or less, the latest you register a shutdown part, the sooner it will be executed. This is the inverse of the start phase.
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 close bit on the instance might need a unit test.
Apart from this, LGTM as semver-major.
Why semver major? |
adding the new properties to the instance is. |
Ok I got you, it is not a major change for avvio itself, but it is for the apps that are using it 👍 |
With this PR we introduce a new queue to handle the shutdown procedure, following the avvio style!
onClose
to add new functions to execute.close
to start the processRelated: fastify/fastify#123
Feedbacks?