Skip to content

Commit dcb0ffd

Browse files
authored
Fix RxResult performance issue in Browser (#1023)
`setImmediate` was slowing down the result consumption since it postpone the execution to the next cycle. Since the cycle in Browser is longer, the issue was more perceptive there. The remove of `setImmediate` doesn't cause any issue with the back-pressure mechanics.
1 parent b6d31dd commit dcb0ffd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/neo4j-driver/src/result-rx.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ function createFullyControlledSubject (
251251
} else {
252252
subject.next(value)
253253
if (!streamControl.paused) {
254-
setImmediate(async () => await pushNextValue(iterator.next()))
254+
pushNextValue(iterator.next())
255+
.catch(() => {})
255256
}
256257
}
257258
} catch (error) {

0 commit comments

Comments
 (0)