Skip to content

Commit ef1c739

Browse files
W-A-Jamesnbbeeken
authored andcommitted
WIP API docs
1 parent 7c3b34c commit ef1c739

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

src/cursor/abstract_cursor.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,17 @@ export interface AbstractCursorOptions extends BSONSerializeOptions {
142142
*/
143143
awaitData?: boolean;
144144
noCursorTimeout?: boolean;
145-
/** Specifies the time an operation will run until it throws a timeout error. See {@link AbstractCursorOptions.timeoutMode} for more details. */
145+
/** Specifies the time an operation will run until it throws a timeout error. See {@link AbstractCursorOptions.timeoutMode} for more details on how this option applies to cursors. */
146146
timeoutMS?: number;
147147
/**
148148
* Specifies how `timeoutMS` is applied to the cursor. Can be either `'cursorLifeTime'` or `'iteration'`
149149
* When set to `'iteration'`, the deadline specified by `timeoutMS` applies to each call of
150150
* `cursor.next()`.
151151
* When set to `'cursorLifetime'`, the deadline applies to the life of the entire cursor.
152152
*
153+
* Note that the use of '`cursorLifetime`' should be limited to relatively short-lived cursors as
154+
* it has the potential to hang on an operation for the entirety of `timeoutMS`.
155+
*
153156
* @example
154157
* # Example showing use of `'iteration'`
155158
* ```ts

src/gridfs/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ export interface GridFSBucketOptions extends WriteConcernOptions {
3838
chunkSizeBytes?: number;
3939
/** Read preference to be passed to read operations */
4040
readPreference?: ReadPreference;
41-
/** Specifies the time an operation will run until it throws a timeout error */
41+
/** Specifies the time an operation will run until it throws a timeout error. Note that the
42+
* deadline specified by this option may be breached if calls to interact with the stream take
43+
* longer than the remaining timeout. FIXME(NODE-6456): what does this even mean?*/
4244
timeoutMS?: number;
4345
}
4446

src/operations/operation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ export abstract class AbstractOperation<TResult = any> {
6161

6262
options: OperationOptions;
6363

64-
/** @internal */
64+
/** @internal TODO(NODE-6197): remove dead code */
6565
timeout?: Timeout;
66-
/** @internal */
66+
/** Specifies the time an operation will run until it throws a timeout error.*/
6767
timeoutMS?: number;
6868

6969
[kSession]: ClientSession | undefined;

src/operations/run_command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export type RunCommandOptions = {
1515
session?: ClientSession;
1616
/** The read preference */
1717
readPreference?: ReadPreferenceLike;
18-
/** @internal */
18+
/** Specifies the time an operation will run until it throws a timeout error */
1919
timeoutMS?: number;
2020
/** @internal */
2121
omitMaxTimeMS?: boolean;

src/sessions.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export interface EndSessionOptions {
103103
force?: boolean;
104104
forceClear?: boolean;
105105

106-
/** @internal */
106+
/** Specifies the time an operation will run until it throws a timeout error */
107107
timeoutMS?: number;
108108
}
109109

@@ -145,7 +145,7 @@ export class ClientSession
145145
[kPinnedConnection]?: Connection;
146146
/** @internal */
147147
[kTxnNumberIncrement]: number;
148-
/** @internal */
148+
/** Specifies the time an operation in a given `ClientSession` will run until it throws a timeout error */
149149
timeoutMS?: number;
150150

151151
/** @internal */
@@ -709,6 +709,8 @@ export class ClientSession
709709
* **IMPORTANT:** Running operations in parallel is not supported during a transaction. The use of `Promise.all`,
710710
* `Promise.allSettled`, `Promise.race`, etc to parallelize operations inside a transaction is
711711
* undefined behaviour.
712+
*
713+
* **IMPORTANT:** When running a
712714
*
713715
*
714716
* @remarks

0 commit comments

Comments
 (0)