From f50288beb1b5a158f6c5bd9c9d46278f98aceccc Mon Sep 17 00:00:00 2001 From: Antonio Barcelos Date: Fri, 25 Nov 2022 13:52:17 +0100 Subject: [PATCH] Fix RxResult performance issue in Browser `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 machanics. --- packages/neo4j-driver/src/result-rx.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/neo4j-driver/src/result-rx.js b/packages/neo4j-driver/src/result-rx.js index f887dc5c2..eb2c8312a 100644 --- a/packages/neo4j-driver/src/result-rx.js +++ b/packages/neo4j-driver/src/result-rx.js @@ -251,7 +251,8 @@ function createFullyControlledSubject ( } else { subject.next(value) if (!streamControl.paused) { - setImmediate(async () => await pushNextValue(iterator.next())) + pushNextValue(iterator.next()) + .catch(() => {}) } } } catch (error) {