()
| 601 | } |
| 602 | |
| 603 | _pulseQueryQueue() { |
| 604 | if (this.readyForQuery === true) { |
| 605 | this._activeQuery = this._queryQueue.shift() |
| 606 | const activeQuery = this._getActiveQuery() |
| 607 | if (activeQuery) { |
| 608 | this.readyForQuery = false |
| 609 | this.hasExecuted = true |
| 610 | |
| 611 | const queryError = activeQuery.submit(this.connection) |
| 612 | if (queryError) { |
| 613 | process.nextTick(() => { |
| 614 | activeQuery.handleError(queryError, this.connection) |
| 615 | this.readyForQuery = true |
| 616 | this._pulseQueryQueue() |
| 617 | }) |
| 618 | } |
| 619 | } else if (this.hasExecuted) { |
| 620 | this._activeQuery = null |
| 621 | this.emit('drain') |
| 622 | } |
| 623 | } |
| 624 | } |
| 625 | |
| 626 | query(config, values, callback) { |
| 627 | // can take in strings, config object or query object |
no test coverage detected