Commit graph

8 commits

Author SHA1 Message Date
Kim Alvefur
43531740f9 util: Prefix module imports with prosody namespace 2023-03-17 16:23:16 +01:00
Matthew Wild
7532eac0e5 util.watchdog: Allow passing a new timeout to :reset() 2022-06-11 22:15:31 +01:00
Matthew Wild
029e093478 util.watchdog: Allow :reset() to restart a cancelled watchdog 2022-06-11 22:15:14 +01:00
Matthew Wild
49a9d5e427 util.watchdog: Update to use "new" util.timer API
When this module was written, it wasn't possible to cancel or reschedule a
timer. Times have changed, and we should take advantage of those new methods.

This module becomes a very thin wrapper around util.timer now, but I'd argue
it's still a very common and useful concept/abstraction to have around.

Possible API change: this removes the 'last_reset' field of the watchdog. This
was never really intended as a public thing, and I can't find any code that
uses it, so I consider removal to be safe.
2022-06-11 21:11:01 +01:00
Kim Alvefur
43b814a83b vairious: Add annotation when an empty environment is set [luacheck] 2018-02-28 20:06:26 +01:00
Kim Alvefur
eaa823a597 util.*: Remove use of module() function, make all module functions local and return them in a table at the end 2015-02-21 10:36:37 +01:00
Matthew Wild
f44fcd3249 util.watchdog: Pass watchdog object to callback so that it doesn't always have to be a closure 2012-05-18 04:22:51 +01:00
Matthew Wild
d53889185a util.watchdog: Watchdog timer library 2011-10-21 17:12:45 -04:00