summaryrefslogtreecommitdiff
path: root/server/src/async/loadfile.lua
blob: e5f270fb923d9cb6728d3567d1d616207bc7ad8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
require 'utility'
local fs = require 'bee.filesystem'

while true do
    local filename = IN:bpop()
    local buf = io.load(fs.path(filename))
    if buf then
        OUT:push(filename, buf)
    end
    collectgarbage()
    GC:push(ID, collectgarbage 'count')
end