The trivial-timer Reference Manual

This is the trivial-timer Reference Manual, version 0.3.10, generated automatically by Declt version 4.0 beta 2 "William Riker" on Thu Feb 15 07:44:18 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 trivial-timer

Easy scheduling of tasks (functions).

Author

Eric Diethelm <>

License

MIT

Version

0.3.10

Dependencies
  • trivial-utilities (system).
  • log4cl (system).
  • bordeaux-threads (system).
  • chanl (system).
  • iterate (system).
Source

trivial-timer.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 trivial-timer/trivial-timer.asd

Source

trivial-timer.asd.

Parent Component

trivial-timer (system).

ASDF Systems

trivial-timer.


3.1.2 trivial-timer/package.lisp

Source

trivial-timer.asd.

Parent Component

trivial-timer (system).

Packages

trivial-timer.


3.1.3 trivial-timer/trivial-timer.lisp

Source

trivial-timer.asd.

Parent Component

trivial-timer (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 trivial-timer

Trivial Timer allows for easy scheduling of tasks (functions). The default tolerance is +- 10ms as defined by **ms-tolerance**.

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Special variables

Special Variable: *ms-tolerance*

Time tolerance (default +/- 10ms)

Package

trivial-timer.

Source

trivial-timer.lisp.


5.1.2 Ordinary functions

Function: cancel-timer-call (id)

Cancel a timer call identified by *ID*.
Returns **T** if the call identified by *ID* was removed.

Package

trivial-timer.

Source

trivial-timer.lisp.

Function: initialize-timer ()

Initialization of trivial-timer. This **MUST** be called before any other function from this library.

Package

trivial-timer.

Source

trivial-timer.lisp.

Function: register-timer-call (offset call &key recurring)

Register a function *call* to be executed in *offset* milliseconds from now. If *recurring* is **T** then *call* will be repeated every *offset* milliseconds. Returns the ID of the registration (to be used with *cancel-timer-call*).

Package

trivial-timer.

Source

trivial-timer.lisp.

Function: register-timer-recurring-call (offset call)

Register a function *call* to be (recurrently) executed every *offset* milliseconds. Returns the ID of the registration (to be used with *cancel-timer-call*).

Package

trivial-timer.

Source

trivial-timer.lisp.

Function: shutdown-timer ()

Shutdown the timer. No further calls can be registered. Atention: Stopping is an asynchronous request, meaning that some registered call might still be executed after calling *shutdown-timer*

Package

trivial-timer.

Source

trivial-timer.lisp.


5.2 Internals


5.2.1 Special variables

Special Variable: *call-id*
Package

trivial-timer.

Source

trivial-timer.lisp.

Special Variable: *call-queue*
Package

trivial-timer.

Source

trivial-timer.lisp.

Special Variable: *call-queue-lock*
Package

trivial-timer.

Source

trivial-timer.lisp.

Special Variable: *ms-to-ticks*
Package

trivial-timer.

Source

trivial-timer.lisp.

Special Variable: *shutdown-requested*
Package

trivial-timer.

Source

trivial-timer.lisp.

Special Variable: *thread-pool*
Package

trivial-timer.

Source

trivial-timer.lisp.

Special Variable: *thread-pool-size*
Package

trivial-timer.

Source

trivial-timer.lisp.

Special Variable: *ticks-tolerance*
Package

trivial-timer.

Source

trivial-timer.lisp.

Special Variable: *timer-initialized*
Package

trivial-timer.

Source

trivial-timer.lisp.

Special Variable: *timer-thread*
Package

trivial-timer.

Source

trivial-timer.lisp.


5.2.2 Ordinary functions

Function: enqueue (thread obj)
Package

trivial-timer.

Source

trivial-timer.lisp.

Function: make-thread-pool-thread ()
Package

trivial-timer.

Source

trivial-timer.lisp.

Function: thread-free? (thread)
Package

trivial-timer.

Source

trivial-timer.lisp.

Function: timer-process ()
Package

trivial-timer.

Source

trivial-timer.lisp.


5.2.3 Generic functions

Generic Reader: call-fn (object)
Package

trivial-timer.

Methods
Reader Method: call-fn ((registered-call registered-call))

automatically generated reader method

Source

trivial-timer.lisp.

Target Slot

call-fn.

Generic Reader: call-id (object)
Package

trivial-timer.

Methods
Reader Method: call-id ((registered-call registered-call))

automatically generated reader method

Source

trivial-timer.lisp.

Target Slot

id.

Generic Reader: call-offset (object)
Package

trivial-timer.

Methods
Reader Method: call-offset ((registered-call registered-call))

automatically generated reader method

Source

trivial-timer.lisp.

Target Slot

offset.

Generic Reader: expected-call-ts (object)
Package

trivial-timer.

Methods
Reader Method: expected-call-ts ((registered-call registered-call))

automatically generated reader method

Source

trivial-timer.lisp.

Target Slot

expected-call-ts.

Generic Writer: (setf expected-call-ts) (object)
Package

trivial-timer.

Methods
Writer Method: (setf expected-call-ts) ((registered-call registered-call))

automatically generated writer method

Source

trivial-timer.lisp.

Target Slot

expected-call-ts.

Generic Reader: queue (object)
Package

trivial-timer.

Methods
Reader Method: queue ((threadpool-thread threadpool-thread))

automatically generated reader method

Source

trivial-timer.lisp.

Target Slot

queue.

Generic Writer: (setf queue) (object)
Package

trivial-timer.

Methods
Writer Method: (setf queue) ((threadpool-thread threadpool-thread))

automatically generated writer method

Source

trivial-timer.lisp.

Target Slot

queue.

Generic Reader: queue-lock (object)
Package

trivial-timer.

Methods
Reader Method: queue-lock ((threadpool-thread threadpool-thread))

automatically generated reader method

Source

trivial-timer.lisp.

Target Slot

queue-lock.

Generic Writer: (setf queue-lock) (object)
Package

trivial-timer.

Methods
Writer Method: (setf queue-lock) ((threadpool-thread threadpool-thread))

automatically generated writer method

Source

trivial-timer.lisp.

Target Slot

queue-lock.

Generic Reader: queue-size (object)
Package

trivial-timer.

Methods
Reader Method: queue-size ((threadpool-thread threadpool-thread))

automatically generated reader method

Source

trivial-timer.lisp.

Target Slot

queue-size.

Generic Writer: (setf queue-size) (object)
Package

trivial-timer.

Methods
Writer Method: (setf queue-size) ((threadpool-thread threadpool-thread))

automatically generated writer method

Source

trivial-timer.lisp.

Target Slot

queue-size.

Generic Reader: recurringp (object)
Package

trivial-timer.

Methods
Reader Method: recurringp ((registered-call registered-call))

automatically generated reader method

Source

trivial-timer.lisp.

Target Slot

recurring.

Generic Reader: thread (object)
Package

trivial-timer.

Methods
Reader Method: thread ((threadpool-thread threadpool-thread))

automatically generated reader method

Source

trivial-timer.lisp.

Target Slot

thread.

Generic Writer: (setf thread) (object)
Package

trivial-timer.

Methods
Writer Method: (setf thread) ((threadpool-thread threadpool-thread))

automatically generated writer method

Source

trivial-timer.lisp.

Target Slot

thread.


5.2.4 Classes

Class: registered-call
Package

trivial-timer.

Source

trivial-timer.lisp.

Direct methods
Direct slots
Slot: id
Type

fixnum

Initargs

:id

Readers

call-id.

Writers

This slot is read-only.

Slot: expected-call-ts
Type

(unsigned-byte 62)

Initargs

:expected-call-ts

Readers

expected-call-ts.

Writers

(setf expected-call-ts).

Slot: offset
Type

(unsigned-byte 62)

Initargs

:offset

Readers

call-offset.

Writers

This slot is read-only.

Slot: call-fn
Type

function

Initargs

:call-fn

Readers

call-fn.

Writers

This slot is read-only.

Slot: recurring
Type

boolean

Initargs

:recurring

Readers

recurringp.

Writers

This slot is read-only.

Class: threadpool-thread
Package

trivial-timer.

Source

trivial-timer.lisp.

Direct methods
Direct slots
Slot: queue-size
Type

fixnum

Initargs

:queue-size

Readers

queue-size.

Writers

(setf queue-size).

Slot: thread
Type

bordeaux-threads:thread

Initargs

:thread

Readers

thread.

Writers

(setf thread).

Slot: queue
Type

chanl:bounded-channel

Initargs

:queue

Readers

queue.

Writers

(setf queue).

Slot: queue-lock
Type

bordeaux-threads:lock

Initargs

:queue-lock

Readers

queue-lock.

Writers

(setf queue-lock).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
C   E   F   G   I   M   Q   R   S   T  
Index Entry  Section

(
(setf expected-call-ts): Private generic functions
(setf expected-call-ts): Private generic functions
(setf queue): Private generic functions
(setf queue): Private generic functions
(setf queue-lock): Private generic functions
(setf queue-lock): Private generic functions
(setf queue-size): Private generic functions
(setf queue-size): Private generic functions
(setf thread): Private generic functions
(setf thread): Private generic functions

C
call-fn: Private generic functions
call-fn: Private generic functions
call-id: Private generic functions
call-id: Private generic functions
call-offset: Private generic functions
call-offset: Private generic functions
cancel-timer-call: Public ordinary functions

E
enqueue: Private ordinary functions
expected-call-ts: Private generic functions
expected-call-ts: Private generic functions

F
Function, cancel-timer-call: Public ordinary functions
Function, enqueue: Private ordinary functions
Function, initialize-timer: Public ordinary functions
Function, make-thread-pool-thread: Private ordinary functions
Function, register-timer-call: Public ordinary functions
Function, register-timer-recurring-call: Public ordinary functions
Function, shutdown-timer: Public ordinary functions
Function, thread-free?: Private ordinary functions
Function, timer-process: Private ordinary functions

G
Generic Function, (setf expected-call-ts): Private generic functions
Generic Function, (setf queue): Private generic functions
Generic Function, (setf queue-lock): Private generic functions
Generic Function, (setf queue-size): Private generic functions
Generic Function, (setf thread): Private generic functions
Generic Function, call-fn: Private generic functions
Generic Function, call-id: Private generic functions
Generic Function, call-offset: Private generic functions
Generic Function, expected-call-ts: Private generic functions
Generic Function, queue: Private generic functions
Generic Function, queue-lock: Private generic functions
Generic Function, queue-size: Private generic functions
Generic Function, recurringp: Private generic functions
Generic Function, thread: Private generic functions

I
initialize-timer: Public ordinary functions

M
make-thread-pool-thread: Private ordinary functions
Method, (setf expected-call-ts): Private generic functions
Method, (setf queue): Private generic functions
Method, (setf queue-lock): Private generic functions
Method, (setf queue-size): Private generic functions
Method, (setf thread): Private generic functions
Method, call-fn: Private generic functions
Method, call-id: Private generic functions
Method, call-offset: Private generic functions
Method, expected-call-ts: Private generic functions
Method, queue: Private generic functions
Method, queue-lock: Private generic functions
Method, queue-size: Private generic functions
Method, recurringp: Private generic functions
Method, thread: Private generic functions

Q
queue: Private generic functions
queue: Private generic functions
queue-lock: Private generic functions
queue-lock: Private generic functions
queue-size: Private generic functions
queue-size: Private generic functions

R
recurringp: Private generic functions
recurringp: Private generic functions
register-timer-call: Public ordinary functions
register-timer-recurring-call: Public ordinary functions

S
shutdown-timer: Public ordinary functions

T
thread: Private generic functions
thread: Private generic functions
thread-free?: Private ordinary functions
timer-process: Private ordinary functions


A.3 Variables

Jump to:   *  
C   E   I   O   Q   R   S   T  
Index Entry  Section

*
*call-id*: Private special variables
*call-queue*: Private special variables
*call-queue-lock*: Private special variables
*ms-to-ticks*: Private special variables
*ms-tolerance*: Public special variables
*shutdown-requested*: Private special variables
*thread-pool*: Private special variables
*thread-pool-size*: Private special variables
*ticks-tolerance*: Private special variables
*timer-initialized*: Private special variables
*timer-thread*: Private special variables

C
call-fn: Private classes

E
expected-call-ts: Private classes

I
id: Private classes

O
offset: Private classes

Q
queue: Private classes
queue-lock: Private classes
queue-size: Private classes

R
recurring: Private classes

S
Slot, call-fn: Private classes
Slot, expected-call-ts: Private classes
Slot, id: Private classes
Slot, offset: Private classes
Slot, queue: Private classes
Slot, queue-lock: Private classes
Slot, queue-size: Private classes
Slot, recurring: Private classes
Slot, thread: Private classes
Special Variable, *call-id*: Private special variables
Special Variable, *call-queue*: Private special variables
Special Variable, *call-queue-lock*: Private special variables
Special Variable, *ms-to-ticks*: Private special variables
Special Variable, *ms-tolerance*: Public special variables
Special Variable, *shutdown-requested*: Private special variables
Special Variable, *thread-pool*: Private special variables
Special Variable, *thread-pool-size*: Private special variables
Special Variable, *ticks-tolerance*: Private special variables
Special Variable, *timer-initialized*: Private special variables
Special Variable, *timer-thread*: Private special variables

T
thread: Private classes