milestone 16: behavioral fixes for silent failures, locks, counters and the query log
This commit is contained in:
@@ -112,9 +112,16 @@ pub fn stream(
|
||||
if (hub.overflowed(io, id)) break;
|
||||
|
||||
const wake = hub.wait(io, id, heartbeat_interval) catch return;
|
||||
if (wake == .timeout) {
|
||||
try w.writeAll(heartbeat);
|
||||
try response.flush();
|
||||
switch (wake) {
|
||||
// Ruling 11 of milestone 16: the server is shutting down. Returning
|
||||
// without `end` leaves the response unterminated, which is what a
|
||||
// shutdown is; the client reconnects or gives up on its own.
|
||||
.closed => return,
|
||||
.timeout => {
|
||||
try w.writeAll(heartbeat);
|
||||
try response.flush();
|
||||
},
|
||||
.ready => {},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user