1
1
'use strict' ;
2
2
const EventEmitter = require ( 'events' ) ;
3
- const ServerDescription = require ( './server_description' ) . ServerDescription ;
4
- const ServerType = require ( './server_description ' ) . ServerType ;
5
- const TopologyDescription = require ( './topology_description' ) . TopologyDescription ;
6
- const TopologyType = require ( './topology_description ' ) . TopologyType ;
3
+ const ServerDescription = require ( './server_description' ) ;
4
+ const ServerType = require ( './common ' ) . ServerType ;
5
+ const TopologyDescription = require ( './topology_description' ) ;
6
+ const TopologyType = require ( './common ' ) . TopologyType ;
7
7
const monitoring = require ( './monitoring' ) ;
8
8
const calculateDurationInMs = require ( '../utils' ) . calculateDurationInMs ;
9
9
const MongoTimeoutError = require ( '../error' ) . MongoTimeoutError ;
@@ -27,6 +27,7 @@ const SrvPoller = require('./srv_polling').SrvPoller;
27
27
const getMMAPError = require ( '../topologies/shared' ) . getMMAPError ;
28
28
const makeStateMachine = require ( '../utils' ) . makeStateMachine ;
29
29
const eachAsync = require ( '../utils' ) . eachAsync ;
30
+ const common = require ( './common' ) ;
30
31
31
32
// Global state
32
33
let globalTopologyCounter = 0 ;
@@ -62,10 +63,10 @@ const LOCAL_SERVER_EVENTS = SERVER_RELAY_EVENTS.concat([
62
63
'ended'
63
64
] ) ;
64
65
65
- const STATE_CLOSING = 'closing' ;
66
- const STATE_CLOSED = 'closed' ;
67
- const STATE_CONNECTING = 'connecting' ;
68
- const STATE_CONNECTED = 'connected' ;
66
+ const STATE_CLOSING = common . STATE_CLOSING ;
67
+ const STATE_CLOSED = common . STATE_CLOSED ;
68
+ const STATE_CONNECTING = common . STATE_CONNECTING ;
69
+ const STATE_CONNECTED = common . STATE_CONNECTED ;
69
70
const stateTransition = makeStateMachine ( {
70
71
[ STATE_CLOSED ] : [ STATE_CLOSED , STATE_CONNECTING ] ,
71
72
[ STATE_CONNECTING ] : [ STATE_CONNECTING , STATE_CLOSING , STATE_CONNECTED , STATE_CLOSED ] ,
0 commit comments