Commit Graph

38 Commits (bc3d454dd6f46292f08f4f724203de22a85800ca)

Author SHA1 Message Date
Matthew Wild ec22a5c10d util.timer: Ensure we don't try to schedule negative timeouts (which rightly upset libevent). Fixes #1135 8 years ago
Kim Alvefur 4872683a42 util.timer: Move sleep() here from util.async 8 years ago
Kim Alvefur 146acdbd33 vairious: Add annotation when an empty environment is set [luacheck] 8 years ago
Kim Alvefur 2200724140 util.statistics,statsd,throttle,timer: Replace dependency on LuaSockect with util.time for precision time 9 years ago
Kim Alvefur 9cf26570d1 util.timer: Reschedule timers from stop() if the next pending event is stopped 10 years ago
Kim Alvefur 669071d1f3 util.timer: If possible, close the existing timer handle in order to have only one 10 years ago
Kim Alvefur 3df8a52d19 util.timer: Expire timer instance if another instance is already set to take care of the next scheduled event 10 years ago
Kim Alvefur 45f9a387a2 util.timer: Keep count of how many timer instances are active 10 years ago
Kim Alvefur 26c4421db4 util.timer: Fix indentation 10 years ago
Kim Alvefur 3015aac8bc util.*: Remove use of module() function, make all module functions local and return them in a table at the end 11 years ago
daurnimator dcd855afaa Move timer code out of util.timer and into relevant net.server backends 11 years ago
daurnimator b3325a4073 util/timer: Re-set params when timer is rescheduled 12 years ago
Waqas Hussain 9fde274e21 util.timer: Import all require upvalues. 12 years ago
Waqas Hussain ad2211ad57 util.timer: Fix another variable name typo (thanks again zash). 12 years ago
Waqas Hussain 0f260f9b4e util.timer: Fix variable name typo. 12 years ago
Waqas Hussain 792398b07e util.timer: Updated to use util.indexedbheap to provide a more complete API. Timers can now be stopped or rescheduled. Callbacks are now pcall'd. Adding/removing timers from within timer callbacks works better. Optional parameter can be passed when creating timer which gets passed to callback, eliminating the need for closures in various timer uses. Timers are now much more lightweight. 12 years ago
Florian Zeitz 4b618a8727 Remove all trailing whitespace 13 years ago
Waqas Hussain 9c852dbe50 util.timer: Always pass the current time to timer callbacks. 14 years ago
Matthew Wild e0832f5491 util.timer: Remove unnecessary require calls, fixes a traceback (thanks nulani) 14 years ago
Matthew Wild 3df4f1a43c net.server, net.timer, net.server_select: Rearrange dependencies between these three modules. server.addtimer() is no longer a public function (renamed to _addtimer) and is not available at all from server_event (compat code removed to prevent traceback) (thanks Nulani) 14 years ago
Matthew Wild ce25b6cbe1 util.timer: Remove unused function imports 14 years ago
Matthew Wild 011d76ac76 util.timer: Variable name change (func -> callback) 14 years ago
Matthew Wild 62e023da82 util.timer: Fix corner case of timer not repeating if it returns <= 0 14 years ago
Waqas Hussain 02b951a1a8 util.timer: Activate higher timer precision. 15 years ago
Waqas Hussain 976c5d8548 util.timer: Activate higher timer precision. 15 years ago
Matthew Wild 90116b3c35 util.timer: When using libevent hold onto the event handle to stop it being collected (and the timer stopping). Fixes BOSH ghosts, thanks Flo, niekie, waqas. 16 years ago
Matthew Wild 2bc0606453 Update copyright headers for 2010 16 years ago
Matthew Wild d7d5b34c60 util.timer: Use luaevent's built-in method of repeating an event (fixes a weird crash) 16 years ago
Matthew Wild 723b03c6bf util.timer: Fix libevent timers (event.base doesn't exist...) 16 years ago
Matthew Wild 89fa12376a util.timer: Use libevent for lightweight timers if available and configured (use_libevent option) 16 years ago
Matthew Wild 59a69e124e util.timer: Pass current_time to timer callbacks 16 years ago
Matthew Wild 118883d655 Remove version number from copyright headers 17 years ago
Matthew Wild c80f91dc02 0.3->0.4 17 years ago
Matthew Wild 0c8bb8e89f util.timer: More small fixes I forgot to commit 17 years ago
Matthew Wild d2631d39ca util.timer: Fix crash when loaded but no tasks set, fix skipping some tasks when multiple set, and one removed 17 years ago
Waqas Hussain 97ea70c7d3 Added util/timer.lua - a timer API 17 years ago