Software /
code /
prosody
Diff
util/async.lua @ 5790:959163e4d631
util.async: Make functions local
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 12 Aug 2013 10:27:08 +0100 |
parent | 5788:3556f338caa3 |
child | 5791:2c98061b6b1e |
line wrap: on
line diff
--- a/util/async.lua Sun Aug 11 14:46:27 2013 +0100 +++ b/util/async.lua Mon Aug 12 10:27:08 2013 +0100 @@ -22,7 +22,7 @@ return true; end -function waiter(num) +local function waiter(num) local thread = coroutine.running(); if not thread then error("Not running in an async context, see http://prosody.im/doc/developers/async"); @@ -54,7 +54,7 @@ end local empty_watchers = {}; -function runner(func, watchers, data) +local function runner(func, watchers, data) return setmetatable({ func = func, thread = false, state = "ready", notified_state = "ready", queue = {}, watchers = watchers or empty_watchers, data = data } , runner_mt);