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

Move duplicated setInterval utility functions from the TCP networking tests to a separate namespace #158

Open rdw-software opened 1 year ago

rdw-software commented 1 year ago

There's at least five different copy/pasted instances of a setInterval function in the scenarios for TCP networking... like this:

-- Creating a simple setInterval wrapper
local uv = require("uv")
local function setInterval(interval, callback)
    local timer = uv.new_timer()
    timer:start(interval, interval, function()
        callback()
    end)
    return timer
end

They should likely be moved to a C_Timer API namespace, and properly tested. Or maybe just relying on libuv tests is enough?