@@ -54,7 +54,7 @@ class Client extends EventEmitter {
54
54
keepAliveInitialDelayMillis : c . keepAliveInitialDelayMillis || 0 ,
55
55
encoding : this . connectionParameters . client_encoding || 'utf8' ,
56
56
} )
57
- this . queryQueue = [ ]
57
+ this . _queryQueue = [ ]
58
58
this . binary = c . binary || defaults . binary
59
59
this . processID = null
60
60
this . secretKey = null
@@ -98,8 +98,8 @@ class Client extends EventEmitter {
98
98
this . _activeQuery = null
99
99
}
100
100
101
- this . queryQueue . forEach ( enqueueError )
102
- this . queryQueue . length = 0
101
+ this . _queryQueue . forEach ( enqueueError )
102
+ this . _queryQueue . length = 0
103
103
}
104
104
105
105
_connect ( callback ) {
@@ -489,8 +489,8 @@ class Client extends EventEmitter {
489
489
con . on ( 'connect' , function ( ) {
490
490
con . cancel ( client . processID , client . secretKey )
491
491
} )
492
- } else if ( client . queryQueue . indexOf ( query ) !== - 1 ) {
493
- client . queryQueue . splice ( client . queryQueue . indexOf ( query ) , 1 )
492
+ } else if ( client . _queryQueue . indexOf ( query ) !== - 1 ) {
493
+ client . _queryQueue . splice ( client . _queryQueue . indexOf ( query ) , 1 )
494
494
}
495
495
}
496
496
@@ -515,7 +515,7 @@ class Client extends EventEmitter {
515
515
516
516
_pulseQueryQueue ( ) {
517
517
if ( this . readyForQuery === true ) {
518
- this . _activeQuery = this . queryQueue . shift ( )
518
+ this . _activeQuery = this . _queryQueue . shift ( )
519
519
const activeQuery = this . _getActiveQuery ( )
520
520
if ( activeQuery ) {
521
521
this . readyForQuery = false
@@ -584,9 +584,9 @@ class Client extends EventEmitter {
584
584
query . callback = ( ) => { }
585
585
586
586
// Remove from queue
587
- const index = this . queryQueue . indexOf ( query )
587
+ const index = this . _queryQueue . indexOf ( query )
588
588
if ( index > - 1 ) {
589
- this . queryQueue . splice ( index , 1 )
589
+ this . _queryQueue . splice ( index , 1 )
590
590
}
591
591
592
592
this . _pulseQueryQueue ( )
@@ -620,7 +620,7 @@ class Client extends EventEmitter {
620
620
return result
621
621
}
622
622
623
- this . queryQueue . push ( query )
623
+ this . _queryQueue . push ( query )
624
624
this . _pulseQueryQueue ( )
625
625
return result
626
626
}
@@ -661,6 +661,10 @@ class Client extends EventEmitter {
661
661
} )
662
662
}
663
663
}
664
+ get queryQueue ( ) {
665
+ console . warn ( 'Warning: Client.queryQueue is deprecated and will be removed in a future version.' )
666
+ return this . _queryQueue
667
+ }
664
668
}
665
669
666
670
// expose a Query constructor
0 commit comments