Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Sockets can emit `close` before `end`, breaking #479. #490
In this week's installment "Node Streams Incompatibility", it turns out that
However, for a
Now, there's a reason why #479 tries to end the wrapper when it gets . It is possible to get
So now we have a case where we can't end on
I'm of the opinion that it is better to hand (visible though difficult to debug) than to throw away data (possibly not visible). Especially since the former case seems to require an explicit call to
Yeah...I'm not sure what we can do about it, honestly. We can't support both the
The best we can do here, is to add some sort of new
I assume something like that would work for you?
That code does inspection on specific http request/response data structures, which we can't really do, since it doesn't apply to all Readables. However, it does give me an idea. See #505.
We can simply punt the issue to the user entirely by allowing the second argument to be an arbitrary handler which can be as simple or complex as necessary. People can then delegate this behavior to a library like