evo-lua / evo-luvi

[Obsolete] Experimental Lua runtime environment built on Luvi (libuv + LuaJIT)
https://evo-lua.github.io
Apache License 2.0
1 stars 0 forks source link

Add specific events to allow handling backpressure in TCP sessions #149

Closed rdw-software closed 1 year ago

rdw-software commented 1 year ago

Goals:

In 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.

rdw-software commented 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.