# HG changeset patch # User Matthew Wild # Date 1376299628 -3600 # Node ID 959163e4d6311a60eae785ada43c23b13b8d37d3 # Parent 3b05a86631b9355e5adda349883e04c91c758dd4 util.async: Make functions local diff -r 3b05a86631b9 -r 959163e4d631 util/async.lua --- 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);