-
Notifications
You must be signed in to change notification settings - Fork 59
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
feat: startCluster return master #83
base: master
Are you sure you want to change the base?
Conversation
new Master(options).ready(callback); | ||
const master = new Master(options); | ||
master.ready(callback); | ||
return master; |
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.
就是当初这里设计的时候, 没有把 master 返回, 有啥原因?
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.
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.
这里其实应该返回 promise
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.
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.
插件里面启动另一个 egg?
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.
嗯,之前的做法是启动一个子进程,再杀掉。
这里 exports 还不够,上层框架也要 exports
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.
datahub 是不是用单进程启动就好了
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.
恩, 我现在遇到的这个场景是可以了
https://github.com/macacajs/macaca-datahub/blob/master/index.js#L57, 他是这样用的.
那看看这样如果没有啥问题了, 可以先合并了. 我先用着呀.
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.
嗯,之前的做法是启动一个子进程,再杀掉。
之前他们可能就是没有办法杀掉, 就用了子进程的方式, 结果还采坑了 eggjs/egg-datahub#9 (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.
那是他们那边子进程没用对吧 😂
exports 这个我没问题,看贯高。
Codecov Report
@@ Coverage Diff @@
## master #83 +/- ##
=========================================
- Coverage 98.57% 98.37% -0.2%
=========================================
Files 8 8
Lines 490 492 +2
=========================================
+ Hits 483 484 +1
- Misses 7 8 +1
Continue to review full report at Codecov.
|
Checklist
npm test
passesAffected core subsystem(s)
Description of change