@@ -112,6 +112,48 @@ describe('examples', () => {
112
112
} ) ;
113
113
} ) ;
114
114
115
+ it ( 'config connection pool example' , done => {
116
+ // tag::config-connection-pool[]
117
+ const driver = neo4j . driver ( uri , neo4j . auth . basic ( user , password ) ,
118
+ {
119
+ maxConnectionLifetime : 30 * 60 * 60 ,
120
+ maxConnectionPoolSize : 50 ,
121
+ connectionAcquisitionTimeout : 2 * 60
122
+ }
123
+ ) ;
124
+ // end::config-connection-pool[]
125
+
126
+ driver . onCompleted = ( ) => {
127
+ done ( ) ;
128
+ } ;
129
+
130
+ const session = driver . session ( ) ;
131
+ session . run ( 'RETURN 1' ) . then ( ( ) => {
132
+ session . close ( ) ;
133
+ driver . close ( ) ;
134
+ } ) ;
135
+ } ) ;
136
+
137
+ it ( 'config load balancing example' , done => {
138
+ // tag::config-load-balancing-strategy[]
139
+ const driver = neo4j . driver ( uri , neo4j . auth . basic ( user , password ) ,
140
+ {
141
+ loadBalancingStrategy : "least_connected"
142
+ }
143
+ ) ;
144
+ // end::config-load-balancing-strategy[]
145
+
146
+ driver . onCompleted = ( ) => {
147
+ done ( ) ;
148
+ } ;
149
+
150
+ const session = driver . session ( ) ;
151
+ session . run ( 'RETURN 1' ) . then ( ( ) => {
152
+ session . close ( ) ;
153
+ driver . close ( ) ;
154
+ } ) ;
155
+ } ) ;
156
+
115
157
it ( 'config max retry time example' , done => {
116
158
// tag::config-max-retry-time[]
117
159
const maxRetryTimeMs = 15 * 1000 ; // 15 seconds
0 commit comments