The trivial-timer Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The trivial-timer Reference Manual

This is the trivial-timer Reference Manual, version 0.3.5, generated automatically by Declt version 2.4 patchlevel 1 "Will Decker" on Mon Jul 29 16:52:29 2019 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

Trivial Timer Manual

[in package TRIVIAL-TIMER]

pipeline status Quicklisp coverage report

Description

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

Installing trivial-timer

This project is available in the latest QuickLisp distribution, so installing it is reduced to calling:

(ql:quickload :trivial-timer)

Working Example

(in-package :trivial-timer)
(initialize-timer)

(defun timer-callback (registered-time delay)
  (log:info "I was called by the timer ~a ms after registration. Expected was ~a ms."
    (- (get-internal-real-time) registered-time) delay))

(let ((delay 1000))
  (register-timer-call delay #'timer-callback))

=> I was called by the timer 992 ms after registration. Expected was 1000 ms.

Exported Symbols

License Information

This library is released under the MIT License. Please refer to the LICENSE to get the full licensing text.

Contributing to this project

Please refer to the CONTRIBUTING document for more information.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

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


Previous: , Up: Systems   [Contents][Index]

2.1 trivial-timer

Author

Eric Diethelm <ediethelm@yahoo.com>

License

MIT

Description

Easy scheduling of tasks (functions).

Version

0.3.5

Dependencies
Source

trivial-timer.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

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


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 trivial-timer.asd

Location

trivial-timer.asd

Systems

trivial-timer (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 trivial-timer/package.lisp

Parent

trivial-timer (system)

Location

package.lisp

Packages

trivial-timer


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 trivial-timer/trivial-timer.lisp

Parent

trivial-timer (system)

Location

trivial-timer.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

3.1.4 trivial-timer/documentation.lisp

Parent

trivial-timer (system)

Location

documentation.lisp

Exported Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

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 (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

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


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Special variables

Special Variable: *ms-tolerance*

Time tolerance (default +/- 10ms)

Package

trivial-timer

Source

trivial-timer.lisp (file)

Special Variable: @trivial-timer-contributing
Package

trivial-timer

Source

documentation.lisp (file)

Special Variable: @trivial-timer-description
Package

trivial-timer

Source

documentation.lisp (file)

Special Variable: @trivial-timer-example
Package

trivial-timer

Source

documentation.lisp (file)

Special Variable: @trivial-timer-exported
Package

trivial-timer

Source

documentation.lisp (file)

Special Variable: @trivial-timer-installing
Package

trivial-timer

Source

documentation.lisp (file)

Special Variable: @trivial-timer-license
Package

trivial-timer

Source

documentation.lisp (file)

Special Variable: @trivial-timer-manual
Package

trivial-timer

Source

documentation.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Functions

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 (file)

Function: register-timer-call OFFSET CALL

Register a function *call* to be executed in *offset* milliseconds from now.

Package

trivial-timer

Source

trivial-timer.lisp (file)

Function: register-timer-recurring-call OFFSET CALL

Register a function *call* to be (recurrently) executed every *offset* milliseconds.

Package

trivial-timer

Source

trivial-timer.lisp (file)

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 (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *call-queue*
Package

trivial-timer

Source

trivial-timer.lisp (file)

Special Variable: *call-queue-lock*
Package

trivial-timer

Source

trivial-timer.lisp (file)

Special Variable: *ms-to-ticks*
Package

trivial-timer

Source

trivial-timer.lisp (file)

Special Variable: *shutdown-requested*
Package

trivial-timer

Source

trivial-timer.lisp (file)

Special Variable: *thread-pool*
Package

trivial-timer

Source

trivial-timer.lisp (file)

Special Variable: *thread-pool-size*
Package

trivial-timer

Source

trivial-timer.lisp (file)

Special Variable: *ticks-tolerance*
Package

trivial-timer

Source

trivial-timer.lisp (file)

Special Variable: *timer-initialized*
Package

trivial-timer

Source

trivial-timer.lisp (file)

Special Variable: *timer-thread*
Package

trivial-timer

Source

trivial-timer.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: enqueue THREAD OBJ
Package

trivial-timer

Source

trivial-timer.lisp (file)

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

trivial-timer

Source

trivial-timer.lisp (file)

Function: thread-free? THREAD
Package

trivial-timer

Source

trivial-timer.lisp (file)

Function: timer-process ()
Package

trivial-timer

Source

trivial-timer.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Generic functions

Generic Function: queue OBJECT
Generic Function: (setf queue) NEW-VALUE OBJECT
Package

trivial-timer

Methods
Method: queue (THREADPOOL-THREAD threadpool-thread)

automatically generated reader method

Source

trivial-timer.lisp (file)

Method: (setf queue) NEW-VALUE (THREADPOOL-THREAD threadpool-thread)

automatically generated writer method

Source

trivial-timer.lisp (file)

Generic Function: queue-lock OBJECT
Generic Function: (setf queue-lock) NEW-VALUE OBJECT
Package

trivial-timer

Methods
Method: queue-lock (THREADPOOL-THREAD threadpool-thread)

automatically generated reader method

Source

trivial-timer.lisp (file)

Method: (setf queue-lock) NEW-VALUE (THREADPOOL-THREAD threadpool-thread)

automatically generated writer method

Source

trivial-timer.lisp (file)

Generic Function: queue-size OBJECT
Generic Function: (setf queue-size) NEW-VALUE OBJECT
Package

trivial-timer

Methods
Method: queue-size (THREADPOOL-THREAD threadpool-thread)

automatically generated reader method

Source

trivial-timer.lisp (file)

Method: (setf queue-size) NEW-VALUE (THREADPOOL-THREAD threadpool-thread)

automatically generated writer method

Source

trivial-timer.lisp (file)

Generic Function: thread OBJECT
Generic Function: (setf thread) NEW-VALUE OBJECT
Package

trivial-timer

Methods
Method: thread (THREADPOOL-THREAD threadpool-thread)

automatically generated reader method

Source

trivial-timer.lisp (file)

Method: (setf thread) NEW-VALUE (THREADPOOL-THREAD threadpool-thread)

automatically generated writer method

Source

trivial-timer.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.4 Classes

Class: threadpool-thread ()
Package

trivial-timer

Source

trivial-timer.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: queue-size
Type

fixnum

Initargs

:queue-size

Readers

queue-size (generic function)

Writers

(setf queue-size) (generic function)

Slot: thread
Type

bordeaux-threads:thread

Initargs

:thread

Readers

thread (generic function)

Writers

(setf thread) (generic function)

Slot: queue
Type

chanl:bounded-channel

Initargs

:queue

Readers

queue (generic function)

Writers

(setf queue) (generic function)

Slot: queue-lock
Type

bordeaux-threads:lock

Initargs

:queue-lock

Readers

queue-lock (generic function)

Writers

(setf queue-lock) (generic function)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   T  
Index Entry  Section

F
File, Lisp, trivial-timer.asd: The trivial-timer<dot>asd file
File, Lisp, trivial-timer/documentation.lisp: The trivial-timer/documentation<dot>lisp file
File, Lisp, trivial-timer/package.lisp: The trivial-timer/package<dot>lisp file
File, Lisp, trivial-timer/trivial-timer.lisp: The trivial-timer/trivial-timer<dot>lisp file

L
Lisp File, trivial-timer.asd: The trivial-timer<dot>asd file
Lisp File, trivial-timer/documentation.lisp: The trivial-timer/documentation<dot>lisp file
Lisp File, trivial-timer/package.lisp: The trivial-timer/package<dot>lisp file
Lisp File, trivial-timer/trivial-timer.lisp: The trivial-timer/trivial-timer<dot>lisp file

T
trivial-timer.asd: The trivial-timer<dot>asd file
trivial-timer/documentation.lisp: The trivial-timer/documentation<dot>lisp file
trivial-timer/package.lisp: The trivial-timer/package<dot>lisp file
trivial-timer/trivial-timer.lisp: The trivial-timer/trivial-timer<dot>lisp file

Jump to:   F   L   T  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

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

(
(setf queue): Internal generic functions
(setf queue): Internal generic functions
(setf queue-lock): Internal generic functions
(setf queue-lock): Internal generic functions
(setf queue-size): Internal generic functions
(setf queue-size): Internal generic functions
(setf thread): Internal generic functions
(setf thread): Internal generic functions

E
enqueue: Internal functions

F
Function, enqueue: Internal functions
Function, initialize-timer: Exported functions
Function, make-thread-pool-thread: Internal functions
Function, register-timer-call: Exported functions
Function, register-timer-recurring-call: Exported functions
Function, shutdown-timer: Exported functions
Function, thread-free?: Internal functions
Function, timer-process: Internal functions

G
Generic Function, (setf queue): Internal generic functions
Generic Function, (setf queue-lock): Internal generic functions
Generic Function, (setf queue-size): Internal generic functions
Generic Function, (setf thread): Internal generic functions
Generic Function, queue: Internal generic functions
Generic Function, queue-lock: Internal generic functions
Generic Function, queue-size: Internal generic functions
Generic Function, thread: Internal generic functions

I
initialize-timer: Exported functions

M
make-thread-pool-thread: Internal functions
Method, (setf queue): Internal generic functions
Method, (setf queue-lock): Internal generic functions
Method, (setf queue-size): Internal generic functions
Method, (setf thread): Internal generic functions
Method, queue: Internal generic functions
Method, queue-lock: Internal generic functions
Method, queue-size: Internal generic functions
Method, thread: Internal generic functions

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

R
register-timer-call: Exported functions
register-timer-recurring-call: Exported functions

S
shutdown-timer: Exported functions

T
thread: Internal generic functions
thread: Internal generic functions
thread-free?: Internal functions
timer-process: Internal functions

Jump to:   (  
E   F   G   I   M   Q   R   S   T  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *   @  
Q   S   T  
Index Entry  Section

*
*call-queue*: Internal special variables
*call-queue-lock*: Internal special variables
*ms-to-ticks*: Internal special variables
*ms-tolerance*: Exported special variables
*shutdown-requested*: Internal special variables
*thread-pool*: Internal special variables
*thread-pool-size*: Internal special variables
*ticks-tolerance*: Internal special variables
*timer-initialized*: Internal special variables
*timer-thread*: Internal special variables

@
@trivial-timer-contributing: Exported special variables
@trivial-timer-description: Exported special variables
@trivial-timer-example: Exported special variables
@trivial-timer-exported: Exported special variables
@trivial-timer-installing: Exported special variables
@trivial-timer-license: Exported special variables
@trivial-timer-manual: Exported special variables

Q
queue: Internal classes
queue-lock: Internal classes
queue-size: Internal classes

S
Slot, queue: Internal classes
Slot, queue-lock: Internal classes
Slot, queue-size: Internal classes
Slot, thread: Internal classes
Special Variable, *call-queue*: Internal special variables
Special Variable, *call-queue-lock*: Internal special variables
Special Variable, *ms-to-ticks*: Internal special variables
Special Variable, *ms-tolerance*: Exported special variables
Special Variable, *shutdown-requested*: Internal special variables
Special Variable, *thread-pool*: Internal special variables
Special Variable, *thread-pool-size*: Internal special variables
Special Variable, *ticks-tolerance*: Internal special variables
Special Variable, *timer-initialized*: Internal special variables
Special Variable, *timer-thread*: Internal special variables
Special Variable, @trivial-timer-contributing: Exported special variables
Special Variable, @trivial-timer-description: Exported special variables
Special Variable, @trivial-timer-example: Exported special variables
Special Variable, @trivial-timer-exported: Exported special variables
Special Variable, @trivial-timer-installing: Exported special variables
Special Variable, @trivial-timer-license: Exported special variables
Special Variable, @trivial-timer-manual: Exported special variables

T
thread: Internal classes

Jump to:   *   @  
Q   S   T  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   P   S   T  
Index Entry  Section

C
Class, threadpool-thread: Internal classes

P
Package, trivial-timer: The trivial-timer package

S
System, trivial-timer: The trivial-timer system

T
threadpool-thread: Internal classes
trivial-timer: The trivial-timer system
trivial-timer: The trivial-timer package

Jump to:   C   P   S   T