Open SupernaviX opened 4 years ago
Just came here to say that I am encountering this problem, too (3.0.0-beta.10). It doesn't affect the correct functionality and I can live with the current implementation. If more people see this as a problem, I would be happy to have a look into the proposed solution (but I am far from being an expert).
Hi!
I've been introducing highland into a Node project at work, and I've noticed that I get warnings from node in certain conditions.
Specifically, when I run this snippet:
I see the following output:
I think that this is happening because the promiseStream function is attaching the promise handlers inside of the new stream. Since the stream constructor is lazy when passed a function, the rejection handler is registered asynchronously; the rejection will be handled (assuming the stream is eventually consumed), but node still yells at me because it isn't handled right away.
Would it make sense to call
promise.then
synchronously when building the stream, to avoid this? I think ifpromiseStream
constructed a new empty stream and usedwrite
when values were available, it could preserve its current behavior without triggering node warnings.