► |  | Web Server: PLT HTTP Server

1 | Running the Web Server
2 | Writing Servlets
3 | Extending the Web Server
4 | Troubleshooting and Tips
5 | Acknowledgements
| Index

► | 3 | Extending the Web Server

3.1 | Configuration
3.2 | Setting Up Servlets
3.3 | Dispatchers
3.4 | Web Config Unit
3.5 | Web Server Unit
3.6 | Internal

▼ | 3.6 | Internal

3.6.1 | Timers
3.6.2 | Connection Manager
3.6.3 | Dispatching Server
3.6.4 | Serializable Closures
3.6.5 | Cache Table
3.6.6 | MIME Types
3.6.7 | Serialization Utilities
3.6.8 | URL Param
3.6.9 | Miscellaneous Utilities

On this page:

timer
start-timer-manager
start-timer
reset-timer!
increment-timer!
cancel-timer!

Version: 4.1.4
top← prev up next →

##### 3.6.1`` Timers

(require web-server/private/timer)

"private/timer.ss" provides a functionality for running procedures after a given amount of time, that may be extended.

(struct timer (evt expire-seconds action))
evt : evt?
expire-seconds : number?
action : (-> void)

evt is an alarm-evt that is ready at expire-seconds. action should be called when this evt is ready.

(start-timer-manager) → void

Handles the execution and management of timers.

(start-timer s action) → timer?
s : number?
action : (-> void)

Registers a timer that runs action after s seconds.

(reset-timer! t s) → void
t : timer?
s : number?

Changes t so that it will fire after s seconds.

(increment-timer! t s) → void
t : timer?
s : number?

Changes t so that it will fire after s seconds from when it does now.

(cancel-timer! t) → void
t : timer?

Cancels the firing of t ever and frees resources used by t.

top← prev up next →