mongodb 6.5.0-dev.20240417.sha.f1f816f → 6.5.0-dev.20240419.sha.c213679
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cmap/connection_pool.js +21 -13
- package/lib/cmap/connection_pool.js.map +1 -1
- package/lib/cursor/aggregation_cursor.js +15 -32
- package/lib/cursor/aggregation_cursor.js.map +1 -1
- package/lib/sdam/topology.js +23 -14
- package/lib/sdam/topology.js.map +1 -1
- package/lib/timeout.js +79 -0
- package/lib/timeout.js.map +1 -0
- package/lib/utils.js +6 -27
- package/lib/utils.js.map +1 -1
- package/mongodb.d.ts +16 -1
- package/package.json +2 -1
- package/src/cmap/connection_pool.ts +31 -29
- package/src/cursor/aggregation_cursor.ts +31 -33
- package/src/index.ts +2 -2
- package/src/sdam/topology.ts +43 -34
- package/src/timeout.ts +100 -0
- package/src/utils.ts +4 -28
package/src/utils.ts
CHANGED
|
@@ -3,7 +3,6 @@ import type { SrvRecord } from 'dns';
|
|
|
3
3
|
import { type EventEmitter } from 'events';
|
|
4
4
|
import { promises as fs } from 'fs';
|
|
5
5
|
import * as http from 'http';
|
|
6
|
-
import { clearTimeout, setTimeout } from 'timers';
|
|
7
6
|
import * as url from 'url';
|
|
8
7
|
import { URL } from 'url';
|
|
9
8
|
import { promisify } from 'util';
|
|
@@ -1203,33 +1202,6 @@ export async function request(
|
|
|
1203
1202
|
});
|
|
1204
1203
|
}
|
|
1205
1204
|
|
|
1206
|
-
/**
|
|
1207
|
-
* A custom AbortController that aborts after a specified timeout.
|
|
1208
|
-
*
|
|
1209
|
-
* If `timeout` is undefined or \<=0, the abort controller never aborts.
|
|
1210
|
-
*
|
|
1211
|
-
* This class provides two benefits over the built-in AbortSignal.timeout() method.
|
|
1212
|
-
* - This class provides a mechanism for cancelling the timeout
|
|
1213
|
-
* - This class supports infinite timeouts by interpreting a timeout of 0 as infinite. This is
|
|
1214
|
-
* consistent with existing timeout options in the Node driver (serverSelectionTimeoutMS, for example).
|
|
1215
|
-
* @internal
|
|
1216
|
-
*/
|
|
1217
|
-
export class TimeoutController extends AbortController {
|
|
1218
|
-
constructor(
|
|
1219
|
-
timeout = 0,
|
|
1220
|
-
private timeoutId = timeout > 0 ? setTimeout(() => this.abort(), timeout) : null
|
|
1221
|
-
) {
|
|
1222
|
-
super();
|
|
1223
|
-
}
|
|
1224
|
-
|
|
1225
|
-
clear() {
|
|
1226
|
-
if (this.timeoutId != null) {
|
|
1227
|
-
clearTimeout(this.timeoutId);
|
|
1228
|
-
}
|
|
1229
|
-
this.timeoutId = null;
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
1232
|
-
|
|
1233
1205
|
/** @internal */
|
|
1234
1206
|
export const DOCUMENT_DB_CHECK = /(\.docdb\.amazonaws\.com$)|(\.docdb-elastic\.amazonaws\.com$)/;
|
|
1235
1207
|
/** @internal */
|
|
@@ -1344,3 +1316,7 @@ export async function fileIsAccessible(fileName: string, mode?: number) {
|
|
|
1344
1316
|
return false;
|
|
1345
1317
|
}
|
|
1346
1318
|
}
|
|
1319
|
+
|
|
1320
|
+
export function noop() {
|
|
1321
|
+
return;
|
|
1322
|
+
}
|