fix: return early to avoid errors with no asyncfns (#616)

When no async functions are supplied, it will be stuck because rx()
waits forever. This diff fixes it.
This commit is contained in:
JINNOUCHI Yasushi 2024-08-19 14:20:57 +09:00 committed by GitHub
parent a3e3bc82a3
commit ec289423a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -53,6 +53,10 @@ end
M.join = function(async_fns)
local len = #async_fns
local results = {}
if len == 0 then
return results
end
local done = 0
local tx, rx = channel.oneshot()