aboutsummaryrefslogtreecommitdiff
path: root/src/server/session/README.txt
blob: ac7d3d4e7675625d09d72ac95e8d5c878cca72eb (plain)
1
2
3
4
5
6
7
8
9
10
11
/**
 * These abstractions rely on NodeJS's cluster module, which allows a parent (master) process to share
 * code with its children (workers). A simple `isMaster` flag indicates who is trying to access
 * the code, and thus determines the functionality that actually gets invoked (checked by the caller, not internally).
 * 
 * Think of the master thread as a factory, and the workers as the helpers that actually run the server.
 * 
 * So, when we run `npm start`, given the appropriate check, initializeMaster() is called in the parent process
 * This will spawn off its own child process (by default, mirrors the execution path of its parent),
 * in which initializeWorker() is invoked.
 */