This is the timer-wheel Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 07:53:47 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
timer-wheel
A timer wheel implementation with BORDEAUX-THREADS backend.
Nick Patrick <npatrick04@gmail.com>
MIT
bordeaux-threads
(system).
src
(module).
Modules are listed depth-first from the system components tree.
timer-wheel/src
timer-wheel
(system).
package.lisp
(file).
utils.lisp
(file).
bt-timeout.lisp
(file).
timer-wheel.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
timer-wheel/timer-wheel.asd
timer-wheel/src/package.lisp
timer-wheel/src/utils.lisp
timer-wheel/src/bt-timeout.lisp
timer-wheel/src/timer-wheel.lisp
timer-wheel/src/utils.lisp
src
(module).
+milliseconds-per-second+
(constant).
context-resolution
(reader method).
(setf context-resolution)
(writer method).
timeout-context
(class).
timeout-overrun
(reader method).
(setf timeout-overrun)
(writer method).
timer-wheel/src/bt-timeout.lisp
src
(module).
bt-timeout-context
(class).
context-end
(reader method).
(setf context-end)
(writer method).
current-milliseconds
(function).
initialize-timer
(function).
make-bt-context
(function).
shutdown-context
(function).
wait-for-timeout
(function).
timer-wheel/src/timer-wheel.lisp
src
(module).
*default-resolution*
(special variable).
*default-size*
(special variable).
initialize-timer-wheel
(function).
make-timer
(function).
make-wheel
(function).
remaining
(reader method).
(setf remaining)
(writer method).
schedule-timer
(function).
shutdown-timer-wheel
(function).
timer
(class).
uninstall-timer
(generic function).
unscheduled
(condition).
wheel
(class).
wheel-resolution
(reader method).
with-timer-wheel
(macro).
calculate-future-slot
(function).
callback
(reader method).
(setf callback)
(writer method).
current-slot
(reader method).
(setf current-slot)
(writer method).
install-timer
(generic function).
installed-slot
(reader method).
(setf installed-slot)
(writer method).
manage-timer-wheel
(function).
reset
(reader method).
(setf reset)
(writer method).
slots
(reader method).
(setf slots)
(writer method).
tick
(generic function).
timeout-lock
(reader method).
(setf timeout-lock)
(writer method).
unscheduled-timer
(reader method).
wheel-context
(reader method).
(setf wheel-context)
(writer method).
wheel-thread
(reader method).
(setf wheel-thread)
(writer method).
Packages are listed by definition order.
timer-wheel
tw
common-lisp
.
*default-resolution*
(special variable).
*default-size*
(special variable).
initialize-timer-wheel
(function).
make-timer
(function).
make-wheel
(function).
remaining
(generic reader).
(setf remaining)
(generic writer).
schedule-timer
(function).
shutdown-timer-wheel
(function).
timer
(class).
uninstall-timer
(generic function).
unscheduled
(condition).
wheel
(class).
wheel-resolution
(generic reader).
with-timer-wheel
(macro).
+milliseconds-per-second+
(constant).
bt-timeout-context
(class).
calculate-future-slot
(function).
callback
(generic reader).
(setf callback)
(generic writer).
context-end
(generic reader).
(setf context-end)
(generic writer).
context-resolution
(generic reader).
(setf context-resolution)
(generic writer).
current-milliseconds
(function).
current-slot
(generic reader).
(setf current-slot)
(generic writer).
initialize-timer
(function).
install-timer
(generic function).
installed-slot
(generic reader).
(setf installed-slot)
(generic writer).
make-bt-context
(function).
manage-timer-wheel
(function).
reset
(generic reader).
(setf reset)
(generic writer).
shutdown-context
(function).
slots
(generic reader).
(setf slots)
(generic writer).
tick
(generic function).
timeout-context
(class).
timeout-lock
(generic reader).
(setf timeout-lock)
(generic writer).
timeout-overrun
(generic reader).
(setf timeout-overrun)
(generic writer).
unscheduled-timer
(generic reader).
wait-for-timeout
(function).
wheel-context
(generic reader).
(setf wheel-context)
(generic writer).
wheel-thread
(generic reader).
(setf wheel-thread)
(generic writer).
Definitions are sorted by export status, category, package, and then by lexicographic order.
milliseconds
slots per wheel
Execute BODY after initializing WHEEL, then
clean up by shutting WHEEL down after leaving the scope.
Ensure the WHEEL is stopped, then initialize the WHEEL context, and start the WHEEL thread.
Return a timer object with CALLBACK being
a function that accepts WHEEL and TIMER arguments.
Make a timer wheel with SIZE slots, with a millisecond RESOLUTION, and BACKEND of :BT (bordeaux-threads... the only backend).
Schedule a timer with one of
:ticks - The number of resolution steps per (wheel-resolution wheel), minimum
of 1 tick.
:milliseconds - The integer number of milliseconds worth of ticks, must be
(and (plusp milliseconds)
(zerop (mod milliseconds (wheel-resolution wheel)))).
:seconds - The real value of seconds, rounded to the nearest resolution tick.
In all cases, the timeout will elapse in no more than
(* calculated-quantity-of-ticks resolution) milliseconds.
The keyword arguments are checked in this order: ticks, milliseconds, seconds for valid values.
Notify the wheel thread to terminate, then wait for it.
Remove TIMER from the WHEEL schedule.
error
.
:timer
This slot is read-only.
:context
(bordeaux-threads:make-lock)
:thread
:slots
0
timer-wheel:*default-resolution*
:resolution
This slot is read-only.
Utility function to get the current time in milliseconds.
Called from the wheel thread.
Return a data structure for managing ticks with BORDEAUX-THREADS
This is the main entry point of the timer WHEEL thread.
This thread maintains a continually updating real-time that it is targetting for precise sleeps. If a sleep cannot be done to reach the target time...i.e. we’ve missed the time getting to this thread, then increment the *timeout-overrun* counter, and keep going as though all was well. I cannot think of any specific failure behavior that would be generically ok.
bt-timeout-context
)) ¶automatically generated reader method
end
.
bt-timeout-context
)) ¶automatically generated writer method
end
.
timeout-context
)) ¶automatically generated reader method
timeout-context
)) ¶automatically generated writer method
Add TIMER to the WHEEL schedule.
Operate one tick of the wheel scedule.
timeout-context
)) ¶automatically generated reader method
timeout-context
)) ¶automatically generated writer method
unscheduled
)) ¶Jump to: | (
C F G I M R S T U W |
---|
Jump to: | (
C F G I M R S T U W |
---|
Jump to: | *
+
C E I R S T |
---|
Jump to: | *
+
C E I R S T |
---|
Jump to: | B C F M P S T U W |
---|
Jump to: | B C F M P S T U W |
---|