libubox/examples
Jo-Philipp Wich 82fa6480de uloop: add support for interval timers
So far, the only way to implement periodic interval timers was to use
one-shot uloop_timeout timers which are rearmed within their completion
callback immediately on expiration.

While simple, this approach is not very precise and interval lengths will
slowly drift over time, due to callback execution overhead, scheduling
granularity etc.

In order to make uloop provide stable and precise interval timer
capabilities, this commit introduces a new `uloop_interval` structure
along with the new related `uloop_interval_set()`, `uloop_interval_cancel()`
and `uloop_interval_remaining()` api functions.

Periodic timers are implemented using the timerfd facility an Linux and
kqueue EVFILT_TIMER events on macOS/BSD.

The Lua binding has been updated to include support for the new timer type
as well.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2023-11-02 17:49:55 +01:00
..
CMakeLists.txt add cram based unit tests 2019-11-24 13:26:58 +01:00
json_script-example.c iron out all extra compiler warnings 2019-11-20 14:34:01 +01:00
json_script-example.json json_script: add "isdir" support 2016-02-20 13:36:08 +01:00
json_script-tests.sh examples: add shunit2 tests for json_script 2016-02-20 13:36:08 +01:00
shunit2 examples: add shunit2 tests for json_script 2016-02-20 13:36:08 +01:00
uloop-example.lua uloop: add support for interval timers 2023-11-02 17:49:55 +01:00
uloop_pid_test.sh add an example script for the uloop lua binding 2012-09-27 13:47:46 +02:00
ustream-example.c examples: add missing include 2014-07-03 12:53:13 +02:00