File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
packages/bolt-connection/src/bolt Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ class ResultStreamObserver extends StreamObserver {
95
95
this . _setState ( reactive ? _states . READY : _states . READY_STREAMING )
96
96
this . _setupAuoPull ( fetchSize )
97
97
this . _pullMode = false ;
98
+ this . _pullScheduled = false ;
98
99
}
99
100
100
101
setPullMode ( pullMode ) {
@@ -360,10 +361,11 @@ class ResultStreamObserver extends StreamObserver {
360
361
361
362
_handleStreaming ( ) {
362
363
if ( this . _head && this . _observers . some ( o => o . onNext || o . onCompleted ) ) {
363
- if ( ! this . _pullMode && ( this . _discard || this . _autoPull ) ) {
364
+ if ( ! this . _pullMode && ( this . _discard || this . _autoPull ) || this . _pullScheduled ) {
364
365
this . _more ( )
365
366
}
366
367
}
368
+ this . _pullScheduled = false
367
369
}
368
370
369
371
_more ( ) {
@@ -373,6 +375,11 @@ class ResultStreamObserver extends StreamObserver {
373
375
this . _moreFunction ( this . _queryId , this . _fetchSize , this )
374
376
}
375
377
this . _setState ( _states . STREAMING )
378
+ this . _pullScheduled = false
379
+ }
380
+
381
+ _schedulePull ( ) {
382
+ this . _pullScheduled = true
376
383
}
377
384
378
385
_storeMetadataForCompletion ( meta ) {
@@ -631,7 +638,7 @@ const _states = {
631
638
name : ( ) => {
632
639
return 'STREAMING'
633
640
} ,
634
- pull : ( ) => { }
641
+ pull : streamObserver => streamObserver . _schedulePull ( )
635
642
} ,
636
643
FAILED : {
637
644
onError : error => {
You can’t perform that action at this time.
0 commit comments