We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4cdf0a5 commit 1c97865Copy full SHA for 1c97865
packages/core/src/result.ts
@@ -254,20 +254,21 @@ class Result implements Promise<QueryResult> {
254
255
const streaming = await this._subscribe(observer, true)
256
const watermarks = streaming.getWatermaks()
257
-
258
- if (streaming.isReady()) {
259
- streaming.pull()
+ const pullIfNeeded = () => {
+ if (observer.queueSize <= watermarks.high) {
+ streaming.pull()
260
+ }
261
}
262
263
+
264
while(true) {
265
+ pullIfNeeded()
266
const value = await observer.consume()
267
if (value.done) {
268
return value.summary!
269
270
271
yield value.record!
- if (observer.queueSize <= watermarks.high) {
- }
272
273
274
0 commit comments