Efficient timer for timeout related timers: fast insertion, deletion, and execution (all as O(1) implemented), but with lesser precision.
This module will not provide the timer/runloop itself. Use your own runloop
and call wheel:step to check and execute timers.
Install through LuaRocks (luarocks install timerwheel) or from source, see the
github repo.
The docs are available online, or can
be generated using Ldoc. Just run
"ldoc ." from the repo.
Tests are in the spec folder and can be executed using the
busted test framework. Just run
"busted" from the repo.
Besides that luacheck is configured for linting, just run "luacheck ." from
the repo. And if LuaCov is installed, the Busted test-run will result in a
coverage report (file "luacov.report.out").
See LICENSE.
Versioning is strictly based on Semantic Versioning.
- create a release branch
- update the changelog below
- update copyright-years in
./LICENSE - create a new rockspec and update the version inside the new rockspec:
cp timerwheel-scm-1.rockspec ./rockspecs/timerwheel-X.Y.Z-1.rockspec - render the docs: run
ldoc . - commit the changes as
release X.Y.Z - push the commit, and create a release PR
- after merging tag the release commit with
X.Y.Z - upload to LuaRocks:
luarocks upload ./rockspecs/timerwheel-X.Y.Z-1.rockspec --api-key=ABCDEFGH - test the newly created rock:
luarocks install timerwheel
- Fix: memory leak, occasionally ID's were not removed. Causing a memory leak in long running processes
- Fix: if a slot was modified (by cancelling) a hole might appear in the table
causing an xpcall with
nilinstead of the callback function
- Bump to 1.0 since API is stable
- Fix: added a newline when writing errors to
stderr, sinceio.stderr:write()does not automatically do this likeprint()does.
- Added
countmethod to retrieve the current number of active timers
- Initial released version