Conversation
…ferred.promise by Promise.race
|
Hey @MurkyMeow! |
|
@MurkyMeow I appreciate the help your effort in pinpointing this! I always had such suspicion about such edge cases with promises but have never yet actually come to meet face to face like this. I think I'd lean towards trying to preserve the "promise style". I've had some thinking and I'm pretty certain the leaking around
- const ownNextEventDeferred = new Deferred<void>();
+ let ownNextEventDeferred = new Deferred<void>();
await Promise.race([
ownNextEventDeferred.promise,
sharedNextEventDeferred.promise,
]);
+ ownNextEventDeferred = new Deferred();I think I managed to observe this is avoiding the accumulation. Would you be kind to check this approach through your scenario as well please? Thanks! 🌠 |
Hey! Absolutely solid work on this library! I've been using it extensively in my finance-related project and it's been a pleasure.
I've noticed a memory leak in my app and traced it down to this line in this library:
I have it fixed here!