influx 5.0.6 → 5.0.7

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/src/pool.js CHANGED
@@ -1,344 +1,344 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
- return function (d, b) {
7
- extendStatics(d, b);
8
- function __() { this.constructor = d; }
9
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10
- };
11
- })();
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- var exponential_1 = require("./backoff/exponential");
14
- var host_1 = require("./host");
15
- var http = require("http");
16
- var https = require("https");
17
- var querystring = require("querystring");
18
- /**
19
- * Status codes that will cause a host to be marked as 'failed' if we get
20
- * them from a request to Influx.
21
- * @type {Array}
22
- */
23
- var resubmitErrorCodes = [
24
- 'ETIMEDOUT',
25
- 'ESOCKETTIMEDOUT',
26
- 'ECONNRESET',
27
- 'ECONNREFUSED',
28
- 'EHOSTUNREACH',
29
- ];
30
- /**
31
- * An ServiceNotAvailableError is returned as an error from requests that
32
- * result in a > 500 error code.
33
- */
34
- var ServiceNotAvailableError = (function (_super) {
35
- __extends(ServiceNotAvailableError, _super);
36
- function ServiceNotAvailableError(message) {
37
- var _this = _super.call(this) || this;
38
- _this.message = message;
39
- Object.setPrototypeOf(_this, ServiceNotAvailableError.prototype);
40
- return _this;
41
- }
42
- return ServiceNotAvailableError;
43
- }(Error));
44
- exports.ServiceNotAvailableError = ServiceNotAvailableError;
45
- /**
46
- * An RequestError is returned as an error from requests that
47
- * result in a 300 <= error code <= 500.
48
- */
49
- var RequestError = (function (_super) {
50
- __extends(RequestError, _super);
51
- function RequestError(req, res, body) {
52
- var _this = _super.call(this) || this;
53
- _this.req = req;
54
- _this.res = res;
55
- _this.message = "A " + res.statusCode + " " + res.statusMessage + " error occurred: " + body;
56
- Object.setPrototypeOf(_this, RequestError.prototype);
57
- return _this;
58
- }
59
- RequestError.Create = function (req, res, callback) {
60
- var body = '';
61
- res.on('data', function (str) { return body = body + str.toString(); });
62
- res.on('end', function () { return callback(new RequestError(req, res, body)); });
63
- };
64
- return RequestError;
65
- }(Error));
66
- exports.RequestError = RequestError;
67
- /**
68
- * Creates a function generation that returns a wrapper which only allows
69
- * through the first call of any function that it generated.
70
- */
71
- function doOnce() {
72
- var handled = false;
73
- return function (fn) {
74
- return function (arg) {
75
- if (handled) {
76
- return;
77
- }
78
- handled = true;
79
- fn(arg);
80
- };
81
- };
82
- }
83
- function setToArray(itemSet) {
84
- var output = [];
85
- itemSet.forEach(function (value) {
86
- output.push(value);
87
- });
88
- return output;
89
- }
90
- var request = function (options, callback) {
91
- if (options.protocol === 'https:') {
92
- return https.request(options, callback);
93
- }
94
- else {
95
- return http.request(options, callback);
96
- }
97
- };
98
- /**
99
- *
100
- * The Pool maintains a list available Influx hosts and dispatches requests
101
- * to them. If there are errors connecting to hosts, it will disable that
102
- * host for a period of time.
103
- */
104
- var Pool = (function () {
105
- /**
106
- * Creates a new Pool instance.
107
- * @param {IPoolOptions} options
108
- */
109
- function Pool(options) {
110
- this.options = Object.assign({
111
- backoff: new exponential_1.ExponentialBackoff({
112
- initial: 300,
113
- max: 10 * 1000,
114
- random: 1,
115
- }),
116
- maxRetries: 2,
117
- requestTimeout: 30 * 1000,
118
- }, options);
119
- this.index = 0;
120
- this.hostsAvailable = new Set();
121
- this.hostsDisabled = new Set();
122
- this.timeout = this.options.requestTimeout;
123
- }
124
- /**
125
- * Returns a list of currently active hosts.
126
- * @return {Host[]}
127
- */
128
- Pool.prototype.getHostsAvailable = function () {
129
- return setToArray(this.hostsAvailable);
130
- };
131
- /**
132
- * Returns a list of hosts that are currently disabled due to network
133
- * errors.
134
- * @return {Host[]}
135
- */
136
- Pool.prototype.getHostsDisabled = function () {
137
- return setToArray(this.hostsDisabled);
138
- };
139
- /**
140
- * Inserts a new host to the pool.
141
- */
142
- Pool.prototype.addHost = function (url, options) {
143
- if (options === void 0) { options = {}; }
144
- var host = new host_1.Host(url, this.options.backoff.reset(), options);
145
- this.hostsAvailable.add(host);
146
- return host;
147
- };
148
- /**
149
- * Returns true if there's any host available to by queried.
150
- * @return {Boolean}
151
- */
152
- Pool.prototype.hostIsAvailable = function () {
153
- return this.hostsAvailable.size > 0;
154
- };
155
- /**
156
- * Makes a request and calls back with the response, parsed as JSON.
157
- * An error is returned on a non-2xx status code or on a parsing exception.
158
- */
159
- Pool.prototype.json = function (options) {
160
- return this.text(options).then(function (res) { return JSON.parse(res); });
161
- };
162
- /**
163
- * Makes a request and resolves with the plain text response,
164
- * if possible. An error is raised on a non-2xx status code.
165
- */
166
- Pool.prototype.text = function (options) {
167
- var _this = this;
168
- return new Promise(function (resolve, reject) {
169
- _this.stream(options, function (err, res) {
170
- if (err) {
171
- return reject(err);
172
- }
173
- var output = '';
174
- res.on('data', function (str) { return output = output + str.toString(); });
175
- res.on('end', function () { return resolve(output); });
176
- });
177
- });
178
- };
179
- /**
180
- * Makes a request and discards any response body it receives.
181
- * An error is returned on a non-2xx status code.
182
- */
183
- Pool.prototype.discard = function (options) {
184
- var _this = this;
185
- return new Promise(function (resolve, reject) {
186
- _this.stream(options, function (err, res) {
187
- if (err) {
188
- return reject(err);
189
- }
190
- res.on('data', function () { });
191
- res.on('end', function () { return resolve(); });
192
- });
193
- });
194
- };
195
- /**
196
- * Ping sends out a request to all available Influx servers, reporting on
197
- * their response time and version number.
198
- */
199
- Pool.prototype.ping = function (timeout, path) {
200
- if (path === void 0) { path = '/ping'; }
201
- var todo = [];
202
- setToArray(this.hostsAvailable)
203
- .concat(setToArray(this.hostsDisabled))
204
- .forEach(function (host) {
205
- var start = Date.now();
206
- var url = host.url;
207
- var once = doOnce();
208
- return todo.push(new Promise(function (resolve) {
209
- var req = request(Object.assign({
210
- hostname: url.hostname,
211
- method: 'GET',
212
- path: path,
213
- port: Number(url.port),
214
- protocol: url.protocol,
215
- timeout: timeout,
216
- }, host.options), once(function (res) {
217
- resolve({
218
- url: url,
219
- res: res,
220
- online: res.statusCode < 300,
221
- rtt: Date.now() - start,
222
- version: res.headers['x-influxdb-version'],
223
- });
224
- }));
225
- var fail = once(function () {
226
- resolve({
227
- online: false,
228
- res: null,
229
- rtt: Infinity,
230
- url: url,
231
- version: null,
232
- });
233
- });
234
- // Support older Nodes and polyfills which don't allow .timeout() in
235
- // the request options, wrapped in a conditional for even worse
236
- // polyfills. See: https://github.com/node-influx/node-influx/issues/221
237
- if (typeof req.setTimeout === 'function') {
238
- req.setTimeout(timeout, fail); // tslint:disable-line
239
- }
240
- req.on('timeout', fail);
241
- req.on('error', fail);
242
- req.end();
243
- }));
244
- });
245
- return Promise.all(todo);
246
- };
247
- /**
248
- * Makes a request and calls back with the IncomingMessage stream,
249
- * if possible. An error is returned on a non-2xx status code.
250
- */
251
- Pool.prototype.stream = function (options, callback) {
252
- var _this = this;
253
- if (!this.hostIsAvailable()) {
254
- return callback(new ServiceNotAvailableError('No host available'), null);
255
- }
256
- var path = options.path;
257
- if (options.query) {
258
- path += '?' + querystring.stringify(options.query);
259
- }
260
- var once = doOnce();
261
- var host = this.getHost();
262
- var req = request(Object.assign({
263
- headers: { 'content-length': options.body ? options.body.length : 0 },
264
- hostname: host.url.hostname,
265
- method: options.method,
266
- path: path,
267
- port: Number(host.url.port),
268
- protocol: host.url.protocol,
269
- timeout: this.timeout,
270
- }, host.options), once(function (res) {
271
- if (res.statusCode >= 500) {
272
- return _this.handleRequestError(new ServiceNotAvailableError(res.statusMessage), host, options, callback);
273
- }
274
- if (res.statusCode >= 300) {
275
- return RequestError.Create(req, res, function (err) { return callback(err, res); });
276
- }
277
- host.success();
278
- return callback(undefined, res);
279
- }));
280
- // Handle network or HTTP parsing errors:
281
- req.on('error', once(function (err) {
282
- _this.handleRequestError(err, host, options, callback);
283
- }));
284
- // Handle timeouts:
285
- req.on('timeout', once(function () {
286
- _this.handleRequestError(new ServiceNotAvailableError('Request timed out'), host, options, callback);
287
- }));
288
- // Support older Nodes and polyfills which don't allow .timeout() in the
289
- // request options, wrapped in a conditional for even worse polyfills. See:
290
- // https://github.com/node-influx/node-influx/issues/221
291
- if (typeof req.setTimeout === 'function') {
292
- req.setTimeout(this.timeout); // tslint:disable-line
293
- }
294
- // Write out the body:
295
- if (options.body) {
296
- req.write(options.body);
297
- }
298
- req.end();
299
- };
300
- /**
301
- * Returns the next available host for querying.
302
- * @return {Host}
303
- */
304
- Pool.prototype.getHost = function () {
305
- var available = setToArray(this.hostsAvailable);
306
- var host = available[this.index];
307
- this.index = (this.index + 1) % available.length;
308
- return host;
309
- };
310
- /**
311
- * Re-enables the provided host, returning it to the pool to query.
312
- * @param {Host} host
313
- */
314
- Pool.prototype.enableHost = function (host) {
315
- this.hostsDisabled.delete(host);
316
- this.hostsAvailable.add(host);
317
- };
318
- /**
319
- * Disables the provided host, removing it from the query pool. It will be
320
- * re-enabled after a backoff interval
321
- */
322
- Pool.prototype.disableHost = function (host) {
323
- var _this = this;
324
- this.hostsAvailable.delete(host);
325
- this.hostsDisabled.add(host);
326
- this.index %= Math.max(1, this.hostsAvailable.size);
327
- setTimeout(function () { return _this.enableHost(host); }, host.fail());
328
- };
329
- Pool.prototype.handleRequestError = function (err, host, options, callback) {
330
- if (!(err instanceof ServiceNotAvailableError) &&
331
- resubmitErrorCodes.indexOf(err.code) === -1) {
332
- return callback(err, null);
333
- }
334
- this.disableHost(host);
335
- var retries = options.retries || 0;
336
- if (retries < this.options.maxRetries && this.hostIsAvailable()) {
337
- options.retries = retries + 1;
338
- return this.stream(options, callback);
339
- }
340
- callback(err, null);
341
- };
342
- return Pool;
343
- }());
344
- exports.Pool = Pool;
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ return function (d, b) {
7
+ extendStatics(d, b);
8
+ function __() { this.constructor = d; }
9
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10
+ };
11
+ })();
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ var exponential_1 = require("./backoff/exponential");
14
+ var host_1 = require("./host");
15
+ var http = require("http");
16
+ var https = require("https");
17
+ var querystring = require("querystring");
18
+ /**
19
+ * Status codes that will cause a host to be marked as 'failed' if we get
20
+ * them from a request to Influx.
21
+ * @type {Array}
22
+ */
23
+ var resubmitErrorCodes = [
24
+ 'ETIMEDOUT',
25
+ 'ESOCKETTIMEDOUT',
26
+ 'ECONNRESET',
27
+ 'ECONNREFUSED',
28
+ 'EHOSTUNREACH',
29
+ ];
30
+ /**
31
+ * An ServiceNotAvailableError is returned as an error from requests that
32
+ * result in a > 500 error code.
33
+ */
34
+ var ServiceNotAvailableError = (function (_super) {
35
+ __extends(ServiceNotAvailableError, _super);
36
+ function ServiceNotAvailableError(message) {
37
+ var _this = _super.call(this) || this;
38
+ _this.message = message;
39
+ Object.setPrototypeOf(_this, ServiceNotAvailableError.prototype);
40
+ return _this;
41
+ }
42
+ return ServiceNotAvailableError;
43
+ }(Error));
44
+ exports.ServiceNotAvailableError = ServiceNotAvailableError;
45
+ /**
46
+ * An RequestError is returned as an error from requests that
47
+ * result in a 300 <= error code <= 500.
48
+ */
49
+ var RequestError = (function (_super) {
50
+ __extends(RequestError, _super);
51
+ function RequestError(req, res, body) {
52
+ var _this = _super.call(this) || this;
53
+ _this.req = req;
54
+ _this.res = res;
55
+ _this.message = "A " + res.statusCode + " " + res.statusMessage + " error occurred: " + body;
56
+ Object.setPrototypeOf(_this, RequestError.prototype);
57
+ return _this;
58
+ }
59
+ RequestError.Create = function (req, res, callback) {
60
+ var body = '';
61
+ res.on('data', function (str) { return body = body + str.toString(); });
62
+ res.on('end', function () { return callback(new RequestError(req, res, body)); });
63
+ };
64
+ return RequestError;
65
+ }(Error));
66
+ exports.RequestError = RequestError;
67
+ /**
68
+ * Creates a function generation that returns a wrapper which only allows
69
+ * through the first call of any function that it generated.
70
+ */
71
+ function doOnce() {
72
+ var handled = false;
73
+ return function (fn) {
74
+ return function (arg) {
75
+ if (handled) {
76
+ return;
77
+ }
78
+ handled = true;
79
+ fn(arg);
80
+ };
81
+ };
82
+ }
83
+ function setToArray(itemSet) {
84
+ var output = [];
85
+ itemSet.forEach(function (value) {
86
+ output.push(value);
87
+ });
88
+ return output;
89
+ }
90
+ var request = function (options, callback) {
91
+ if (options.protocol === 'https:') {
92
+ return https.request(options, callback);
93
+ }
94
+ else {
95
+ return http.request(options, callback);
96
+ }
97
+ };
98
+ /**
99
+ *
100
+ * The Pool maintains a list available Influx hosts and dispatches requests
101
+ * to them. If there are errors connecting to hosts, it will disable that
102
+ * host for a period of time.
103
+ */
104
+ var Pool = (function () {
105
+ /**
106
+ * Creates a new Pool instance.
107
+ * @param {IPoolOptions} options
108
+ */
109
+ function Pool(options) {
110
+ this.options = Object.assign({
111
+ backoff: new exponential_1.ExponentialBackoff({
112
+ initial: 300,
113
+ max: 10 * 1000,
114
+ random: 1,
115
+ }),
116
+ maxRetries: 2,
117
+ requestTimeout: 30 * 1000,
118
+ }, options);
119
+ this.index = 0;
120
+ this.hostsAvailable = new Set();
121
+ this.hostsDisabled = new Set();
122
+ this.timeout = this.options.requestTimeout;
123
+ }
124
+ /**
125
+ * Returns a list of currently active hosts.
126
+ * @return {Host[]}
127
+ */
128
+ Pool.prototype.getHostsAvailable = function () {
129
+ return setToArray(this.hostsAvailable);
130
+ };
131
+ /**
132
+ * Returns a list of hosts that are currently disabled due to network
133
+ * errors.
134
+ * @return {Host[]}
135
+ */
136
+ Pool.prototype.getHostsDisabled = function () {
137
+ return setToArray(this.hostsDisabled);
138
+ };
139
+ /**
140
+ * Inserts a new host to the pool.
141
+ */
142
+ Pool.prototype.addHost = function (url, options) {
143
+ if (options === void 0) { options = {}; }
144
+ var host = new host_1.Host(url, this.options.backoff.reset(), options);
145
+ this.hostsAvailable.add(host);
146
+ return host;
147
+ };
148
+ /**
149
+ * Returns true if there's any host available to by queried.
150
+ * @return {Boolean}
151
+ */
152
+ Pool.prototype.hostIsAvailable = function () {
153
+ return this.hostsAvailable.size > 0;
154
+ };
155
+ /**
156
+ * Makes a request and calls back with the response, parsed as JSON.
157
+ * An error is returned on a non-2xx status code or on a parsing exception.
158
+ */
159
+ Pool.prototype.json = function (options) {
160
+ return this.text(options).then(function (res) { return JSON.parse(res); });
161
+ };
162
+ /**
163
+ * Makes a request and resolves with the plain text response,
164
+ * if possible. An error is raised on a non-2xx status code.
165
+ */
166
+ Pool.prototype.text = function (options) {
167
+ var _this = this;
168
+ return new Promise(function (resolve, reject) {
169
+ _this.stream(options, function (err, res) {
170
+ if (err) {
171
+ return reject(err);
172
+ }
173
+ var output = '';
174
+ res.on('data', function (str) { return output = output + str.toString(); });
175
+ res.on('end', function () { return resolve(output); });
176
+ });
177
+ });
178
+ };
179
+ /**
180
+ * Makes a request and discards any response body it receives.
181
+ * An error is returned on a non-2xx status code.
182
+ */
183
+ Pool.prototype.discard = function (options) {
184
+ var _this = this;
185
+ return new Promise(function (resolve, reject) {
186
+ _this.stream(options, function (err, res) {
187
+ if (err) {
188
+ return reject(err);
189
+ }
190
+ res.on('data', function () { });
191
+ res.on('end', function () { return resolve(); });
192
+ });
193
+ });
194
+ };
195
+ /**
196
+ * Ping sends out a request to all available Influx servers, reporting on
197
+ * their response time and version number.
198
+ */
199
+ Pool.prototype.ping = function (timeout, path) {
200
+ if (path === void 0) { path = '/ping'; }
201
+ var todo = [];
202
+ setToArray(this.hostsAvailable)
203
+ .concat(setToArray(this.hostsDisabled))
204
+ .forEach(function (host) {
205
+ var start = Date.now();
206
+ var url = host.url;
207
+ var once = doOnce();
208
+ return todo.push(new Promise(function (resolve) {
209
+ var req = request(Object.assign({
210
+ hostname: url.hostname,
211
+ method: 'GET',
212
+ path: path,
213
+ port: Number(url.port),
214
+ protocol: url.protocol,
215
+ timeout: timeout,
216
+ }, host.options), once(function (res) {
217
+ resolve({
218
+ url: url,
219
+ res: res,
220
+ online: res.statusCode < 300,
221
+ rtt: Date.now() - start,
222
+ version: res.headers['x-influxdb-version'],
223
+ });
224
+ }));
225
+ var fail = once(function () {
226
+ resolve({
227
+ online: false,
228
+ res: null,
229
+ rtt: Infinity,
230
+ url: url,
231
+ version: null,
232
+ });
233
+ });
234
+ // Support older Nodes and polyfills which don't allow .timeout() in
235
+ // the request options, wrapped in a conditional for even worse
236
+ // polyfills. See: https://github.com/node-influx/node-influx/issues/221
237
+ if (typeof req.setTimeout === 'function') {
238
+ req.setTimeout(timeout, fail); // tslint:disable-line
239
+ }
240
+ req.on('timeout', fail);
241
+ req.on('error', fail);
242
+ req.end();
243
+ }));
244
+ });
245
+ return Promise.all(todo);
246
+ };
247
+ /**
248
+ * Makes a request and calls back with the IncomingMessage stream,
249
+ * if possible. An error is returned on a non-2xx status code.
250
+ */
251
+ Pool.prototype.stream = function (options, callback) {
252
+ var _this = this;
253
+ if (!this.hostIsAvailable()) {
254
+ return callback(new ServiceNotAvailableError('No host available'), null);
255
+ }
256
+ var path = options.path;
257
+ if (options.query) {
258
+ path += '?' + querystring.stringify(options.query);
259
+ }
260
+ var once = doOnce();
261
+ var host = this.getHost();
262
+ var req = request(Object.assign({
263
+ headers: { 'content-length': options.body ? new Buffer(options.body).length : 0 },
264
+ hostname: host.url.hostname,
265
+ method: options.method,
266
+ path: path,
267
+ port: Number(host.url.port),
268
+ protocol: host.url.protocol,
269
+ timeout: this.timeout,
270
+ }, host.options), once(function (res) {
271
+ if (res.statusCode >= 500) {
272
+ return _this.handleRequestError(new ServiceNotAvailableError(res.statusMessage), host, options, callback);
273
+ }
274
+ if (res.statusCode >= 300) {
275
+ return RequestError.Create(req, res, function (err) { return callback(err, res); });
276
+ }
277
+ host.success();
278
+ return callback(undefined, res);
279
+ }));
280
+ // Handle network or HTTP parsing errors:
281
+ req.on('error', once(function (err) {
282
+ _this.handleRequestError(err, host, options, callback);
283
+ }));
284
+ // Handle timeouts:
285
+ req.on('timeout', once(function () {
286
+ _this.handleRequestError(new ServiceNotAvailableError('Request timed out'), host, options, callback);
287
+ }));
288
+ // Support older Nodes and polyfills which don't allow .timeout() in the
289
+ // request options, wrapped in a conditional for even worse polyfills. See:
290
+ // https://github.com/node-influx/node-influx/issues/221
291
+ if (typeof req.setTimeout === 'function') {
292
+ req.setTimeout(this.timeout); // tslint:disable-line
293
+ }
294
+ // Write out the body:
295
+ if (options.body) {
296
+ req.write(options.body);
297
+ }
298
+ req.end();
299
+ };
300
+ /**
301
+ * Returns the next available host for querying.
302
+ * @return {Host}
303
+ */
304
+ Pool.prototype.getHost = function () {
305
+ var available = setToArray(this.hostsAvailable);
306
+ var host = available[this.index];
307
+ this.index = (this.index + 1) % available.length;
308
+ return host;
309
+ };
310
+ /**
311
+ * Re-enables the provided host, returning it to the pool to query.
312
+ * @param {Host} host
313
+ */
314
+ Pool.prototype.enableHost = function (host) {
315
+ this.hostsDisabled.delete(host);
316
+ this.hostsAvailable.add(host);
317
+ };
318
+ /**
319
+ * Disables the provided host, removing it from the query pool. It will be
320
+ * re-enabled after a backoff interval
321
+ */
322
+ Pool.prototype.disableHost = function (host) {
323
+ var _this = this;
324
+ this.hostsAvailable.delete(host);
325
+ this.hostsDisabled.add(host);
326
+ this.index %= Math.max(1, this.hostsAvailable.size);
327
+ setTimeout(function () { return _this.enableHost(host); }, host.fail());
328
+ };
329
+ Pool.prototype.handleRequestError = function (err, host, options, callback) {
330
+ if (!(err instanceof ServiceNotAvailableError) &&
331
+ resubmitErrorCodes.indexOf(err.code) === -1) {
332
+ return callback(err, null);
333
+ }
334
+ this.disableHost(host);
335
+ var retries = options.retries || 0;
336
+ if (retries < this.options.maxRetries && this.hostIsAvailable()) {
337
+ options.retries = retries + 1;
338
+ return this.stream(options, callback);
339
+ }
340
+ callback(err, null);
341
+ };
342
+ return Pool;
343
+ }());
344
+ exports.Pool = Pool;