You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 4, 2022. It is now read-only.
consterror=newMongoError('Cannot use a session that has ended');
13
+
if(typeofcallback==='function'){
14
+
returncallback(error,null);
15
+
}
16
+
17
+
throwerror;
18
+
}
19
+
};
20
+
21
+
/** A class representing a client session on the server */
12
22
classClientSessionextendsEventEmitter{
23
+
24
+
/**
25
+
* Create a client session.
26
+
* WARNING: not meant to be instantiated directly
27
+
*
28
+
* @param {Topology} topology The current client's topology
29
+
* @param {ServerSessionPool} sessionPool The server session pool
30
+
* @param {Object} [options] Optional settings
31
+
* @param {Boolean} [options.causalConsistency] Whether causal consistency should be enabled on this session
32
+
* @param {Boolean} [options.autoStartTransaction=false] When enabled this session automatically starts a transaction with the provided defaultTransactionOptions.
33
+
* @param {Object} [options.defaultTransactionOptions] The default TransactionOptions to use for transactions started on this session.
34
+
*/
13
35
constructor(topology,sessionPool,options){
14
36
super();
15
37
@@ -42,10 +64,20 @@ class ClientSession extends EventEmitter {
0 commit comments