-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. add `Boot` Class, developer can inherit from it. 2. add `startBoot`, application like egg should call `startBoot` after all files loaded. Refs: eggjs/egg#2520
- Loading branch information
Showing
20 changed files
with
609 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
'use strict'; | ||
|
||
class BootClass { | ||
/** | ||
* @constructor | ||
* @param {EggApplication} app - app instance | ||
*/ | ||
constructor(app) { | ||
this.app = app; | ||
|
||
/** | ||
* will be triggered after plugin.js, config.js, | ||
* extends, app.js/agent.js did loaded | ||
* @method configDidLoad | ||
*/ | ||
|
||
/** | ||
* will be triggered after all files did loaded | ||
* @async | ||
* @method didLoad | ||
*/ | ||
|
||
/** | ||
* all plugins are ready | ||
* @async | ||
* @method willReady | ||
*/ | ||
|
||
/** | ||
* after all `willReady` ready | ||
* @async | ||
* @method didReady | ||
*/ | ||
|
||
/** | ||
* all workers, agent is ready | ||
* @async | ||
* @method serverDidReady | ||
*/ | ||
|
||
/** | ||
* before process exit | ||
* not safe | ||
* @async | ||
* @method beforeClose | ||
*/ | ||
} | ||
} | ||
|
||
module.exports = BootClass; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.