Software / code / prosody
Comparison
util/timer.lua @ 6777:5de6b93d0190
util.*: Remove use of module() function, make all module functions local and return them in a table at the end
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 21 Feb 2015 10:36:37 +0100 |
| parent | 5776:bd0ff8ae98a8 |
| child | 6791:e813e8cf6046 |
| child | 7988:dc758422d896 |
comparison
equal
deleted
inserted
replaced
| 6774:3965662ae091 | 6777:5de6b93d0190 |
|---|---|
| 15 local type = type; | 15 local type = type; |
| 16 | 16 |
| 17 local data = {}; | 17 local data = {}; |
| 18 local new_data = {}; | 18 local new_data = {}; |
| 19 | 19 |
| 20 module "timer" | 20 local _ENV = nil; |
| 21 | 21 |
| 22 local _add_task; | 22 local _add_task; |
| 23 if not server.event then | 23 if not server.event then |
| 24 function _add_task(delay, callback) | 24 function _add_task(delay, callback) |
| 25 local current_time = get_time(); | 25 local current_time = get_time(); |
| 76 end | 76 end |
| 77 , delay); | 77 , delay); |
| 78 end | 78 end |
| 79 end | 79 end |
| 80 | 80 |
| 81 add_task = _add_task; | 81 return { |
| 82 | 82 add_task = _add_task; |
| 83 return _M; | 83 }; |