Skip to content

Commit cb3bb53

Browse files
committed
docs: update comments
1 parent 9003f08 commit cb3bb53

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/sdam/monitor.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ function resetMonitorState(monitor: Monitor) {
225225

226226
function useStreamingProtocol(monitor: Monitor, topologyVersion: TopologyVersion | null): boolean {
227227
// If we have no topology version we always poll no matter
228-
// what the user provided.
228+
// what the user provided, since the server does not support
229+
// the streaming protocol.
229230
if (topologyVersion == null) return false;
230231

231232
const serverMonitoringMode = monitor.options.serverMonitoringMode;
@@ -317,6 +318,8 @@ function checkServer(monitor: Monitor, callback: Callback<Document | null>) {
317318
new ServerHeartbeatSucceededEvent(monitor.address, duration, hello, isAwaitable)
318319
);
319320

321+
// If we are using the streaming protocol then we immediately issue another 'started'
322+
// event, otherwise the "check" is complete and return to the main monitor loop.
320323
if (isAwaitable) {
321324
monitor.emit(
322325
Server.SERVER_HEARTBEAT_STARTED,

0 commit comments

Comments
 (0)