mirror of
https://github.com/kikito/cron.lua.git
synced 2024-12-19 18:34:20 +00:00
code reordering
This commit is contained in:
parent
8dd3dae68b
commit
73b4eb6bf6
9
cron.lua
9
cron.lua
@ -10,6 +10,11 @@
|
||||
-- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
-- Private functions
|
||||
|
||||
local entries = {}
|
||||
|
||||
local function isCallable(callback)
|
||||
local tc = type(callback)
|
||||
if tc == 'function' then return true end
|
||||
@ -25,8 +30,6 @@ local function checkTimeAndCallback(time, callback)
|
||||
assert(isCallable(callback), "callback must be a function")
|
||||
end
|
||||
|
||||
local entries = {}
|
||||
|
||||
local function newEntry(time, callback, update, ...)
|
||||
local entry = {
|
||||
time = time,
|
||||
@ -56,6 +59,8 @@ local function updatePeriodicEntry(self, dt)
|
||||
end
|
||||
end
|
||||
|
||||
-- Public functions
|
||||
|
||||
local cron = {}
|
||||
|
||||
function cron.reset()
|
||||
|
Loading…
Reference in New Issue
Block a user