Comparison

util/async.lua @ 8669:2aa85b0cd2b8

util.async: Use wrapper for once runner (thanks luacheck)
author Kim Alvefur <zash@zash.se>
date Thu, 22 Mar 2018 23:15:04 +0100
parent 8655:ba6a6a04b46c
child 8681:0c077800cd70
comparison
equal deleted inserted replaced
8668:31c5abd49dfe 8669:2aa85b0cd2b8
229 error(err); 229 error(err);
230 end; 230 end;
231 }; 231 };
232 local function once_runner(func) func(); end 232 local function once_runner(func) func(); end
233 function once(func) 233 function once(func)
234 local r = runner(func, once_watchers); 234 local r = runner(once_runner, once_watchers);
235 return r:run(func); 235 return r:run(func);
236 end 236 end
237 end 237 end
238 238
239 local function sleep(s) 239 local function sleep(s)