equal
deleted
inserted
replaced
|
1 This module is an experiment about a more graceful shutdown process. |
|
2 |
|
3 Why |
|
4 === |
|
5 |
|
6 When shutting down, a number of sessions, connections and other things |
|
7 are teared down. Due to all these things happening very quickly, |
|
8 sometimes eg client unavailable notifications don't make it to all |
|
9 remote contacts because the server-to-server connections are teared down |
|
10 just after. |
|
11 |
|
12 How |
|
13 === |
|
14 |
|
15 This module works by breaking the shutdown process into separate steps |
|
16 with a brief pause between them. |
|
17 |
|
18 It goes something like this |
|
19 |
|
20 1. Stop accepting new client connections. |
|
21 2. Close all client connections. |
|
22 3. Fire event for everything else. |
|
23 4. Tell `net.server` to quit the main loop. |
|
24 5. ??? |
|
25 6. Still here? Kill itself. |
|
26 |