Closed rdw-software closed 1 year ago
While working on this I noticed the code feels somewhat messy already, mostly due to libuv callback soup and some inconsistencies between client and servers. There are only minimal unit tests because of all the callbacks, too. I'm not sure if anything can be done about this without mocking all the libuv/luv APIs, which I'd rather avoid, or finding better abstractions like async/await (coroutines).
It's probably worth keeping an eye on the TCP modules to avoid creeping tech debt as more features are needed in the future.
Goals:
TCP_BACKPRESSURE_DETECTED
event when the libuv write buffer reaches a preconfigured thresholdTCP_BACKPRESSURE_EASED
insteadIn NodeJS (and luvit), this is basically the
drain
event, which is implemented by all Streams (in NodeJS at least).However, I'd rather have more descriptive and non-generic events for the different streams.