diff options
Diffstat (limited to 'script/async/loadfile.lua')
-rw-r--r-- | script/async/loadfile.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/script/async/loadfile.lua b/script/async/loadfile.lua new file mode 100644 index 00000000..b9d0f41c --- /dev/null +++ b/script/async/loadfile.lua @@ -0,0 +1,13 @@ +require 'utility' +local fs = require 'bee.filesystem' + +while true do + local filename, mode = IN:bpop() + local buf = io.load(fs.path(filename)) + if buf then + OUT:push(filename, mode, buf) + else + ERR:push('Load failed:' .. filename) + end + GC:push(ID, collectgarbage 'count') +end |