Skip to content
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

调整 server.before 触发点以及添加 process.exit 方法 #9

Merged
merged 2 commits into from
Dec 21, 2015

Conversation

YuhangGe
Copy link

  1. 将 server.before 方法的触发时间调整在 http.createServer 之后,并且将该 server 通过 args.server 传递给 plugin,使得 plugin 可以配置 server。这个改动点完全向前兼容。
  2. 添加 process.exit 方法,在应用退出时,插件可以利用这个方法进行一些资源回收等操作,比如清空临时文件夹,释放文件占用或端口,等。

add process exit method
_applyPlugins('process.exit');
}
notDestroy = false;
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • process.exit 换成 exit ?
  • process.on 可以改成 process.once,这样不用担心注册多次

sorrycc added a commit that referenced this pull request Dec 21, 2015
调整 server.before 触发点以及添加 process.exit 方法
@sorrycc sorrycc merged commit 1726e57 into master Dec 21, 2015
@sorrycc
Copy link
Member

sorrycc commented Dec 21, 2015

👍

@sorrycc sorrycc deleted the add-process-exit-method branch December 21, 2015 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants