Constructing the Kitten Server
Flowchart from the Technical Manual.
Text version
- Server.getInstanceAsync(options)
- Server.instance exists?
- Resolve with Server.instance
- Server.isBeingConstructedViaFactoryMethod = true
- new Server() – synchronous constructor
- isBeingConstructedViaFactoryMethod?
- Throw: Server is a singleton
- Error.stackTraceLimit = 50
- On uncaughtException: log it, exit 99 (restartRequest)
- On SIGTERM or SIGINT: exit 0 so JSDB flushes
- await initialise(options)