forked from eggjs/egg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc (loader.md): Add missing English translations (eggjs#2996)
1) Add missing English translations about the explainations of start process in details. 2) Format some words in a beautiful style.
- Loading branch information
Showing
5 changed files
with
228 additions
and
12 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
File renamed without changes.
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,131 @@ | ||
@startuml | ||
start | ||
: start master; | ||
partition agent { | ||
: fork agent worker; | ||
: load plugin.js, config.js, extends; | ||
: load agent.js; | ||
note right | ||
class mode | ||
configDidLoad | ||
async didLoad | ||
async willReady | ||
async didReady | ||
async serverDidReady | ||
==== | ||
method mode | ||
beforeStart(deprecate) | ||
end note | ||
fork | ||
: configDidLoad; | ||
note left | ||
all the files are loaded | ||
To execute some sync logic | ||
end note | ||
: async didLoad; | ||
note left | ||
Files and configs are loaded | ||
To execute some async tasks | ||
E.g: Pull configs in async to load client, | ||
or check the state of client | ||
end note | ||
fork again | ||
: beforeStart(deprecate); | ||
note right | ||
Tasks mounted on beforeStart | ||
Running in parallel at this time | ||
end note | ||
endfork | ||
: async willReady; | ||
note left | ||
All the plug-ins are loaded, | ||
All the plug-ins are normal, | ||
To execute some tasks before request enters, | ||
E.g: Pull some configs for applications | ||
end note | ||
: async didReady; | ||
note right | ||
agent is ready, | ||
and it can work normally | ||
==== | ||
The time is the same as 'ready', | ||
The original 'ready' doesn't support AsyncFunction | ||
end note | ||
: emit 'agent-start'; | ||
} | ||
partition app { | ||
: start app workers; | ||
: load plugin.js, config.js, extends; | ||
: load app.js; | ||
note right | ||
class mode | ||
configDidLoad | ||
async didLoad | ||
async willReady | ||
async didReady | ||
async serverDidReady | ||
==== | ||
method mode | ||
beforeStart(deprecate) | ||
end note | ||
fork | ||
: configDidLoad; | ||
note left | ||
All the files are loaded, | ||
The same sync logic as in app.js, | ||
Some configs can be modified, the order of middlewares | ||
end note | ||
: load app/service; | ||
: load app/middleware; | ||
: load app/controller; | ||
: load app/router.js; | ||
: async DidLoad; | ||
note left | ||
Files and configs are loaded | ||
To execute some async tasks | ||
E.g: Pull configs in async to load client, | ||
or check the state of client | ||
end note | ||
fork again | ||
: beforeStart(deprecate); | ||
note right | ||
Tasks mounted on beforeStart | ||
Running in parallel at this time | ||
end note | ||
end fork | ||
: async WillReady; | ||
note left | ||
All the plug-ins are loaded, | ||
All the plug-ins are normal, | ||
To execute some tasks before request enters, | ||
E.g: Pull some configs for applications | ||
end note | ||
: async DidReady; | ||
note right | ||
app is ready | ||
HTTP server starts listening at the port | ||
==== | ||
The time is the same as 'ready', | ||
The original 'ready' doesn't support AsyncFunction | ||
end note | ||
: emit 'app-start'; | ||
} | ||
: emit 'egg-ready'; | ||
: async serverDidReady; | ||
note right | ||
agent and all the apps are ready | ||
requests are allowed | ||
end note | ||
: master receive SIGTERM; | ||
fork | ||
: agent beforeClose; | ||
fork again | ||
: app beforeClose; | ||
note right | ||
To execute in a reversed order against the inserting | ||
DO NOT recommend in PROD env, | ||
May not finish before the process ends | ||
end note | ||
endfork | ||
stop | ||
@enduml |
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